Skip to content

Commit 9adeb56

Browse files
authored
Merge pull request #8393 from k8s-infra-cherrypick-robot/cherry-pick-8388-to-cluster-autoscaler-release-1.30
[cluster-autoscaler-release-1.30] CA: add release automation validation
2 parents 4733218 + b4206a2 commit 9adeb56

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

cluster-autoscaler/Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,20 @@ build-in-docker-arch-%: clean-arch-% docker-builder
111111
docker run ${RM_FLAG} -v `pwd`:/gopath/src/k8s.io/autoscaler/cluster-autoscaler/:Z autoscaling-builder:latest \
112112
bash -c 'cd /gopath/src/k8s.io/autoscaler/cluster-autoscaler && BUILD_TAGS=${BUILD_TAGS} LDFLAGS="${LDFLAGS}" make build-arch-$*'
113113

114-
release: $(addprefix build-in-docker-arch-,$(ALL_ARCH)) execute-release
114+
release-extract-version = $(shell cat version/version.go | grep "Version =" | cut -d '"' -f 2)
115+
116+
release-validate:
117+
@if [ -z $(shell git tag --points-at HEAD | grep -e ^cluster-autoscaler-1.[1-9][0-9]*.[0-9][0-9]*$) ]; then \
118+
echo "Can't release from this commit, there is no compatible git tag"; \
119+
exit 1; \
120+
fi
121+
@if [ -z $(shell git tag --points-at HEAD | grep -e $(call release-extract-version)) ]; then \
122+
echo "Can't release from this commit, git tag does not match version/version.go"; \
123+
exit 1; \
124+
fi
125+
126+
release: TAG=v$(call release-extract-version)
127+
release: release-validate $(addprefix build-in-docker-arch-,$(ALL_ARCH)) execute-release
115128
@echo "Full in-docker release ${TAG}${FOR_PROVIDER} completed"
116129

117130
container: container-arch-$(GOARCH)

0 commit comments

Comments
 (0)