Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added release script to the makefile #8030

Merged
merged 1 commit into from
May 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

MAKEFLAGS = -s
GIT_STATUS := $(shell git status --porcelain)

export GOBIN=$(PWD)/bin
export GO111MODULE=on
Expand Down Expand Up @@ -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
Expand Down