Skip to content

Commit

Permalink
sync dtmcli dtmgrpc version ok
Browse files Browse the repository at this point in the history
  • Loading branch information
yedf2 committed Oct 15, 2021
1 parent baa4547 commit 9b38510
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion dtmcli/db_special.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
30 changes: 17 additions & 13 deletions helper/sync-dtmcli.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

0 comments on commit 9b38510

Please sign in to comment.