diff --git a/scripts/build.sh b/scripts/build.sh index ef232460f..fa0e03e3c 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -17,6 +17,7 @@ cd "$DIR" GIT_COMMIT="$(git rev-parse --short HEAD)" GIT_DIRTY="$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)" GIT_DESCRIBE="$(git describe --tags --always)" +GIT_IMPORT="github.com/hashicorp/consul/version" # Determine the arch/os combos we're building for XC_ARCH=${XC_ARCH:-"386 amd64 arm"} @@ -40,7 +41,7 @@ echo "==> Building..." -os="${XC_OS}" \ -arch="${XC_ARCH}" \ -osarch="!darwin/arm" \ - -ldflags "-X main.GitCommit='${GIT_COMMIT}${GIT_DIRTY}' -X main.GitDescribe='${GIT_DESCRIBE}'" \ + -ldflags "-X ${GIT_IMPORT}.GitCommit='${GIT_COMMIT}${GIT_DIRTY}' -X ${GIT_IMPORT}.GitDescribe='${GIT_DESCRIBE}'" \ -output "pkg/{{.OS}}_{{.Arch}}/consul" \ -tags="${BUILD_TAGS}" \ .