diff --git a/hack/tfw.sh b/hack/tfw.sh index d2921c0..b22e3f4 100755 --- a/hack/tfw.sh +++ b/hack/tfw.sh @@ -39,8 +39,7 @@ release_baseimage() read -p "Tag and push new TFW version \"${TAG}\"? [y/N]" -r && echo if [[ $REPLY =~ ^(y|Y|yes|Yes|YES)$ ]] then - git tag -s -m "$1" "$TAG" - git push origin $TAG + TAG="$TAG" force_push_tag fi } @@ -55,6 +54,14 @@ check_drone_releasename() fi } +force_push_tag() +{ + git tag -d "$TAG" > /dev/null 2>&1 || : + git push --delete origin "$TAG" > /dev/null 2>&1 || : + git tag -s -m "$1" "$TAG" + git push origin "$TAG" +} + baseimage_releasename() { VERSION="$(cat VERSION | head -n 1)"