diff --git a/api/VERSION b/api/VERSION new file mode 100644 index 0000000000..1f3e3c351b --- /dev/null +++ b/api/VERSION @@ -0,0 +1 @@ +v2.1-rc1 diff --git a/api/build.sh b/api/build.sh index 811eb84269..5bae5d28b3 100755 --- a/api/build.sh +++ b/api/build.sh @@ -19,6 +19,9 @@ set -ex export ENV=local pwd=`pwd` +VERSION=$(cat ./api/VERSION) +GIT_VERSION=$(git log -1 --pretty=format:%h) + rm -rf output && mkdir -p output/conf && mkdir -p output/dag-to-lua # get dag-to-lua lib @@ -29,7 +32,7 @@ if [[ ! -f "dag-to-lua-1.1/lib/dag-to-lua.lua" ]]; then fi # build -cd ./api && go build -o ../output/manager-api . && cd .. +cd ./api && go build -o ../output/manager-api -ldflags "-X main.Version=${VERSION}(${GIT_VERSION})" . && cd .. cp ./api/conf/schema.json ./output/conf/schema.json cp ./api/conf/conf.yaml ./output/conf/conf.yaml