Add ability to force tag

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and Jari Kolehmainen committed 2021-06-22 08:34:39 +03:00
1 parent 38b6383f5c
commit ac51a7bbe9
2 files changed
+14 -3

No files matched your search

+1 -1
View File
@@ -44,7 +44,7 @@ release-version:
.PHONY: tag-release
tag-release:
scripts/tag-release.sh
scripts/tag-release.sh $(CMD_ARGS)
.PHONY: test
test: binaries/client
+13 -2
View File
@@ -1,10 +1,21 @@
#!/bin/bash
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-f|--force)
FORCE="--force"
shift # past argument
;;
esac
done
if [[ `git branch --show-current` =~ ^release/v ]]
then
VERSION_STRING=$(cat package.json | jq '.version' -r | xargs printf "v%s")
git tag ${VERSION_STRING}
git push ${GIT_REMOTE:-origin} ${VERSION_STRING}
git tag ${VERSION_STRING} ${FORCE}
git push ${GIT_REMOTE:-origin} ${VERSION_STRING} ${FORCE}
else
echo "You must be in a release branch"
fi