From 461304388fb35a53f4e673340ac61758f045575a Mon Sep 17 00:00:00 2001 From: Khash Sajadi Date: Sat, 13 Apr 2019 16:31:44 +0100 Subject: [PATCH] more Signed-off-by: Khash Sajadi --- .buildkite/build.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.buildkite/build.sh b/.buildkite/build.sh index 3d4972f..9e695f0 100644 --- a/.buildkite/build.sh +++ b/.buildkite/build.sh @@ -1,9 +1,7 @@ #!/bin/bash -version=$(git describe --tags --always) force="false" - -if [[ $FORCE == "--force" ]] +if [[ $FORCE == "force" ]] then force="true" fi @@ -11,8 +9,10 @@ fi if [[ $BUILDKITE_BRANCH == "master" ]] then channel="edge" + version=$(git describe --tags --always) else channel="stable" + version=$BUILDKITE_TAG fi echo "Building $channel/$version" @@ -26,8 +26,12 @@ echo echo "Building" -docker run -i --rm -w /gopath/src/github.com/cloud66/trackman -v $(pwd):/gopath/src/github.com/cloud66/trackman cloud66/gobuildchain /bin/bash << COMMANDS +docker run -i -e GITHUB_TOKEN=$GITHUB_TOKEN --rm -w /gopath/src/github.com/cloud66/trackman -v $(pwd):/gopath/src/github.com/cloud66/trackman cloud66/gobuildchain:2 /bin/bash << COMMANDS gox -ldflags "-X github.com/cloud66/trackman/utils.Version=$version -X github.com/cloud66/trackman/utils.Channel=$channel" -os="darwin linux windows" -arch="amd64" -output "build/{{.OS}}_{{.Arch}}_$version" +if [[ $channel -eq "stable" ]] + then + ghr -u cloud66 -r trackman -soft $version build/ +fi chown -R 999:998 build COMMANDS