Merge pull request #1014 from smarterclayton/set_commit_with_ldflags

Use -ldflags to set git commit version
This commit is contained in:
Joe Beda
2014-08-26 10:56:56 -07:00
6 changed files with 33 additions and 72 deletions

View File

@@ -28,8 +28,8 @@ hackdir=$(CDPATH="" cd $(dirname $0); pwd)
# 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[@]}"