From e594d76671f3088bf802f4b3239926e7c8b19788 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Tue, 10 May 2022 10:41:32 +0200 Subject: [PATCH] Provide scripts for tagging releases --- README.md | 16 ++++++++++++++++ bin/tag-hotfix.sh | 13 +++++++++++++ bin/tag-release.sh | 13 +++++++++++++ 3 files changed, 42 insertions(+) create mode 100755 bin/tag-hotfix.sh create mode 100755 bin/tag-release.sh diff --git a/README.md b/README.md index f27ef63c..66e832ca 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,22 @@ deployed in the evening, if there are new commits that are not yet on Heroku. ### Tagging +#### Update: + +Please use one of the provided scripts in `bin` + +```./bin/tag-release.sh``` + +or + +```./bin/tag-hotfix.sh``` + +and follow the instructions. + +Note: Please make sure you're one the master branch first. + +#### Manual Way (deprecated) + Whenever you do a new release, please tag the current commit after merging with the current date: git tag -a v2019-09-10 diff --git a/bin/tag-hotfix.sh b/bin/tag-hotfix.sh new file mode 100755 index 00000000..e2d9a36d --- /dev/null +++ b/bin/tag-hotfix.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +BRANCH="$(git rev-parse --abbrev-ref HEAD)" +if [[ "$BRANCH" != "master" ]]; then + echo "Not on master branch, aborting" + exit 1 +fi + +today=`date "+%Y-%m-%d"` +hotfix_tag=v$today.hotfix +git tag -am "Hotfix release to production on $today" $hotfix_tag +echo "please push the tag with" +echo "git push origin $hotfix_tag" diff --git a/bin/tag-release.sh b/bin/tag-release.sh new file mode 100755 index 00000000..1f2cf096 --- /dev/null +++ b/bin/tag-release.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +BRANCH="$(git rev-parse --abbrev-ref HEAD)" +if [[ "$BRANCH" != "master" ]]; then + echo "Not on master branch, aborting" + exit 1 +fi + +today=`date +"%Y-%m-%d"` +tag=v${today} +git tag -a $tag -m "Release to production on ${today}" +echo "please push the tag with" +echo "git push origin $tag"