aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-12-30 19:18:06 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-12-30 19:30:02 +0100
commit9dfc2ec6b19fd6dba2222913f460d5105cf7e8b8 (patch)
treed0a0f697cdb014dcf776514cc81802bd6cce088b
parent3b272210ce1c3c344eaf5a91ce977631492575a5 (diff)
downloadvendor_replicant-release-scripts-9dfc2ec6b19fd6dba2222913f460d5105cf7e8b8.tar.gz
vendor_replicant-release-scripts-9dfc2ec6b19fd6dba2222913f460d5105cf7e8b8.tar.bz2
vendor_replicant-release-scripts-9dfc2ec6b19fd6dba2222913f460d5105cf7e8b8.zip
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 <GNUtoo@cyberdimension.org>
-rwxr-xr-xreleasetag.sh16
1 files 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: <REPLICANT_DIR>"
+ echo "$SCRIPT: <REPLICANT_DIR> [-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