From 9dfc2ec6b19fd6dba2222913f460d5105cf7e8b8 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Thu, 30 Dec 2021 19:18:06 +0100 Subject: releasetag.sh: Add force option to force git tag and git push The releases are now built from a source tarball that is then officially released and signed as part of the release process. So having to force push to correct mistakes during a release is still possible until that tarball is signed and officially released. Signed-off-by: Denis 'GNUtoo' Carikli --- releasetag.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/releasetag.sh b/releasetag.sh index 734fa3d..370d397 100755 --- a/releasetag.sh +++ b/releasetag.sh @@ -22,6 +22,7 @@ set -e # Variables SCRIPT=$0 REPLICANT_DIR=$1 +FORCE=$2 . $(dirname $0)/releasevars.sh @@ -35,10 +36,10 @@ tag_repos () { cd "$REPLICANT_DIR" TAG_MESSAGE="Replicant $(echo $RELEASE | sed 's/-/ /') images release" TAGGING_CMD="echo \"Tagging $color_start \$REPO_PROJECT $color_end\" && \ - git tag -u $RELEASE_KEY -m \"${TAG_MESSAGE}\" \ + git tag ${FORCE} -u $RELEASE_KEY -m \"${TAG_MESSAGE}\" \ \"replicant-$RELEASE\"" PUSHING_CMD="echo \"Pushing $color_start \$REPO_PROJECT $color_end\" && \ - git push \"git@$PUSH_REMOTE:\$REPO_PROJECT\" \"replicant-$RELEASE\"" + git push ${FORCE} \"git@$PUSH_REMOTE:\$REPO_PROJECT\" \"replicant-$RELEASE\"" repo forall -c "$TAGGING_CMD && $PUSHING_CMD" repo forall -c "$TAGGING_CMD && $PUSHING_CMD" @@ -47,14 +48,17 @@ tag_repos () { } print_help () { - echo "$SCRIPT: " + echo "$SCRIPT: [-f]" + echo "" + echo " -f, --force use git tag --force and git push --force" + exit 1 } # Check for the correct number of args -if [ "$#" -lt "$ARGS_COUNT" ] -then +if [ "$#" -lt "$ARGS_COUNT" ] ; then + print_help +elif [ "$#" -eq 2 -a "$2" != "-f" -a "$2" != "--force" ] ; then print_help - exit 1 fi tag_repos -- cgit v1.2.3