Browse Source

sync dtmcli dtmgrpc version ok

pull/43/head v1.3.0
yedf2 5 years ago
parent
commit
9b38510976
  1. 2
      dtmcli/db_special.go
  2. 30
      helper/sync-dtmcli.sh

2
dtmcli/db_special.go

@ -85,7 +85,7 @@ func GetDBSpecial() DBSpecial {
// SetCurrentDBType set currentDBType
func SetCurrentDBType(dbType string) {
spec := dbSpecials[dbType]
PanicIf(spec == nil, fmt.Errorf("unknown db type %s", dbType))
PanicIf(spec == nil, fmt.Errorf("unknown db type '%s'", dbType))
currentDBType = dbType
}

30
helper/sync-dtmcli.sh

@ -1,11 +1,12 @@
#! /bin/bash
set -x
if [ x$1 == x ]; then
ver=$1
if [ x$ver == x ]; then
echo please specify you version like vx.x.x;
exit 1;
fi
if [ ${1:1:1} != v ]; then
if [ ${ver:0:1} != v ]; then
echo please specify you version like vx.x.x;
exit 1;
fi
@ -15,40 +16,43 @@ cp ../dtm/dtmcli/*.go ./
rm -f *_test.go
go mod tidy
go build || exit 1
git add .
git commit -m'update from dtm'
git commit -m"update from dtm to version $ver"
git push
# git tag $1
# git push --tags
git tag $ver
git push --tags
cd ../dtmcli-go-sample
sleep 5
go get -u github.com/yedf/dtmcli
go mod tidy
go build || exit 1
git add .
git commit -m'update from dtm'
git commit -m"update from dtm to version $ver"
git push
cd ../dtmgrpc
cp ../dtm/dtmgrpc/*.go ./
cp ../dtm/dtmgrpc/*.proto ./
go get -u github.com/yedf/dtmcli
sed -i '' -e 's/yedf\/dtm\//yedf\//g' *.go *.proto
rm -rf *_test.go
go get -u github.com/yedf/dtmcli
go mod tidy
go build || exit 1
git add .
git commit -m'update from dtm'
git commit -m"update from dtm to version $ver"
git push
# git tag $1
# git push --tags
git tag $ver
git push --tags
cd ../dtmgrpc-go-sample
sleep 5
go get -u github.com/yedf/dtmcli
go get -u github.com/yedf/dtmgrpc
cp ../dtm/dtmgrpc/*.proto ./
sed -i '' -e 's/yedf\/dtm\//yedf\//g' *.go *.proto
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative busi/*.proto || exit 1
go build || exit 1
git add .
git commit -m'update from dtm'
git commit -m"update from dtm to version $ver"
git push
Loading…
Cancel
Save