Use -ldflags to set git commit version

This commit is contained in:
Clayton Coleman
2014-08-25 09:21:03 -04:00
parent 0a06de63dc
commit 9336373857
6 changed files with 33 additions and 72 deletions

View File

@@ -28,8 +28,8 @@ hackdir=$(dirname "$0")
# Go to the top of the tree.
cd "${KUBE_REPO_ROOT}"
# Update the version.
"${hackdir}/version-gen.sh"
# Fetch the version.
version=$(gitcommit)
if [[ $# == 0 ]]; then
# Update $@ with the default list of targets to build.
@@ -41,4 +41,4 @@ for arg; do
binaries+=("${KUBE_GO_PACKAGE}/${arg}")
done
go install "${binaries[@]}"
go install -ldflags "-X github.com/GoogleCloudPlatform/kubernetes/pkg/version.commitFromGit '${version}'" "${binaries[@]}"