From c54416291d54e7a0a49ee392930bc613b1e9a571 Mon Sep 17 00:00:00 2001 From: Andres Taylor Date: Tue, 4 May 2021 11:57:01 +0200 Subject: [PATCH] Added release script to the makefile Signed-off-by: Andres Taylor --- Makefile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Makefile b/Makefile index f84918bb2e1..fdd2d529652 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ # limitations under the License. MAKEFLAGS = -s +GIT_STATUS := $(shell git status --porcelain) export GOBIN=$(PWD)/bin export GO111MODULE=on @@ -302,6 +303,43 @@ release: docker_base echo "git push origin v$(VERSION)" echo "Also, don't forget the upload releases/v$(VERSION).tar.gz file to GitHub releases" +do_release: +ifndef RELEASE_VERSION + echo "Set the env var RELEASE_VERSION with the release version" + exit 1 +endif +ifndef DEV_VERSION + echo "Set the env var DEV_VERSION with the version the dev branch should have after release" + exit 1 +endif +ifeq ($(strip $(GIT_STATUS)),) + echo so much clean +else + echo cannot do release with dirty git state + exit 1 + echo so much win +endif +# Pre checks passed. Let's change the current version + cd java && mvn versions:set -DnewVersion=$(RELEASE_VERSION) + echo package servenv > go/vt/servenv/version.go + echo >> go/vt/servenv/version.go + echo const versionName = \"$(RELEASE_VERSION)\" >> go/vt/servenv/version.go + echo -n Pausing so relase notes can be added. Press enter to continue + read line + git add --all + git commit -n -s -m "Release commit for $(RELEASE_VERSION)" + git tag -m Version\ $(RELEASE_VERSION) v$(RELEASE_VERSION) + cd java && mvn versions:set -DnewVersion=$(DEV_VERSION) + echo package servenv > go/vt/servenv/version.go + echo >> go/vt/servenv/version.go + echo const versionName = \"$(DEV_VERSION)\" >> go/vt/servenv/version.go + git add --all + git commit -n -s -m "Back to dev mode" + echo "Release preparations successful" + echo "A git tag was created, you can push it with:" + echo " git push upstream v$(RELEASE_VERSION)" + echo "The git branch has also been updated. You need to push it and get it merged" + tools: echo $$(date): Installing dependencies ./bootstrap.sh