consul/.circleci/bash_env.sh
Mark Anderson d8663a741d Fixup build scripts
Signed-off-by: Mark Anderson <manderson@hashicorp.com>
2022-06-09 17:04:05 -07:00

9 lines
543 B
Bash

#!/bin/bash
export GIT_COMMIT=$(git rev-parse --short HEAD)
export GIT_COMMIT_YEAR=$(git show -s --format=%cd --date=format:%Y HEAD)
export GIT_DIRTY=$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)
export GIT_IMPORT=github.com/hashicorp/consul/version
export GIT_DATE=$("${CIRCLE_WORKING_DIRECTORY}/build-support/scripts/build-date.sh") # we're using this for build date because it's stable across platform builds
export GOLDFLAGS="-X ${GIT_IMPORT}.GitCommit=${GIT_COMMIT}${GIT_DIRTY} -X $(GIT_IMPORT).BuildDate=$(GIT_DATE)"