mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 19:21:37 +00:00
Merge pull request #1014 from smarterclayton/set_commit_with_ldflags
Use -ldflags to set git commit version
This commit is contained in:
@@ -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[@]}"
|
||||
|
Reference in New Issue
Block a user