You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ma...@apache.org on 2019/10/22 10:46:19 UTC
[servicecomb-service-center] branch master updated: Add syncer's
packaging command to the script of release
This is an automated email from the ASF dual-hosted git repository.
mabin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git
The following commit(s) were added to refs/heads/master by this push:
new a9878e1 Add syncer's packaging command to the script of release
new f561b9a Merge pull request #596 from ChinX/syncer-script
a9878e1 is described below
commit a9878e1426515655d6df9d20348e567d23cbb87c
Author: chinx <c5...@126.com>
AuthorDate: Tue Oct 22 10:44:07 2019 +0800
Add syncer's packaging command to the script of release
---
scripts/build/local.sh | 2 ++
scripts/build/tools.sh | 17 +++++++++++++++++
scripts/release/make_release.sh | 4 +++-
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/scripts/build/local.sh b/scripts/build/local.sh
index 869627a..487a3e1 100644
--- a/scripts/build/local.sh
+++ b/scripts/build/local.sh
@@ -42,6 +42,8 @@ personal_build() {
build_scctl
+ build_syncer
+
package
}
diff --git a/scripts/build/tools.sh b/scripts/build/tools.sh
index c971d65..bed602e 100644
--- a/scripts/build/tools.sh
+++ b/scripts/build/tools.sh
@@ -99,6 +99,23 @@ build_scctl() {
cd -
}
+build_syncer() {
+ local app=../$PACKAGE_PREFIX-$PACKAGE-$GOOS-$GOARCH
+ ## Build the syncer releases
+ cd syncer
+ export GIT_COMMIT=$(git log --pretty=format:'%h' -n 1)
+ export BUILD_NUMBER=$RELEASE
+ local ldflags="${GO_LDFLAGS} -X 'github.com/apache/servicecomb-service-center/syncer/version.BUILD_TAG=$(date +%Y%m%d%H%M%S).$BUILD_NUMBER.$GIT_COMMIT'"
+ ldflags="${ldflags} -X 'github.com/apache/servicecomb-service-center/syncer/version.VERSION=$BUILD_NUMBER'"
+
+ local BINARY_NAME=$app/syncer
+ if [ "$GOOS" == "windows" ]; then
+ BINARY_NAME=${BINARY_NAME}.exe
+ fi
+ go build --ldflags "${ldflags}" -o $BINARY_NAME
+ cd -
+}
+
sc_deps() {
install_glide
diff --git a/scripts/release/make_release.sh b/scripts/release/make_release.sh
index fe965f1..2f154bb 100755
--- a/scripts/release/make_release.sh
+++ b/scripts/release/make_release.sh
@@ -18,7 +18,7 @@
set -e
## Get the Release Number
-if [ $2 == "" ]; then
+if [[ $2 == "" ]]; then
echo "Invalid version number....exiting...."
exit 1
else
@@ -74,6 +74,8 @@ build() {
build_scctl
+ build_syncer
+
package
}