Skip to content

Commit

Permalink
Merge pull request #8030 from planetscale/release-script
Browse files Browse the repository at this point in the history
Added release script to the makefile
  • Loading branch information
askdba authored May 4, 2021
2 parents bc7e785 + c544162 commit fe422bb
Showing 1 changed file with 38 additions and 0 deletions.
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

0 comments on commit fe422bb

Please sign in to comment.