Skip to content

Commit c52fdb3

Browse files
authored
Merge pull request #5473 from CecileRobertMichon/git-version
🐛 Use release tag as git version for building clusterctl binaries
2 parents daf93aa + 9868e0f commit c52fdb3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ release: clean-release ## Builds and push container images using the latest git
528528
@if ! [ -z "$$(git status --porcelain)" ]; then echo "Your local git repository contains uncommitted changes, use git clean before proceeding."; exit 1; fi
529529
git checkout "${RELEASE_TAG}"
530530
# Build binaries first.
531-
$(MAKE) release-binaries
531+
GIT_VERSION=$(RELEASE_TAG) $(MAKE) release-binaries
532532
# Set the manifest image to the production bucket.
533533
$(MAKE) manifest-modification REGISTRY=$(PROD_REGISTRY)
534534
## Build the manifests

hack/version.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ version::get_version_vars() {
2929

3030
# stolen from k8s.io/hack/lib/version.sh
3131
# Use git describe to find the version based on annotated tags.
32-
if GIT_VERSION=$(git describe --abbrev=14 --match "v[0-9]*" 2>/dev/null); then
32+
if [[ -n ${GIT_VERSION-} ]] || GIT_VERSION=$(git describe --abbrev=14 --match "v[0-9]*" 2>/dev/null); then
3333
# This translates the "git describe" to an actual semver.org
3434
# compatible semantic version that looks something like this:
3535
# v1.1.0-alpha.0.6+84c76d1142ea4d

0 commit comments

Comments
 (0)