diff options
author | Björn Mattsson <bjorn@sunet.se> | 2023-10-19 16:05:58 +0200 |
---|---|---|
committer | Björn Mattsson <bjorn@sunet.se> | 2023-10-19 16:05:58 +0200 |
commit | af3487b9c4a9b630d88b55c2bcc4bedf257cab4a (patch) | |
tree | 2b6988b2c2cb434e8a14cad14430c0537a2d0c8f /scripts |
Added files from Wiki + base files for repo
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bump-tag | 43 | ||||
-rwxr-xr-x | scripts/do-update.sh | 3 | ||||
-rwxr-xr-x | scripts/verify-tag | 14 |
3 files changed, 60 insertions, 0 deletions
diff --git a/scripts/bump-tag b/scripts/bump-tag new file mode 100755 index 0000000..7cb8507 --- /dev/null +++ b/scripts/bump-tag @@ -0,0 +1,43 @@ +#!/bin/sh + +set -e + +git pull + +tagpfx=${tag:="md"} + +last_tag=`git tag -l "${tagpfx}-*"|sort|tail -1` + +echo "Verifying last tag $last_tag:" +(git tag -v $last_tag | grep ^gpg:) || true +# again to not mask exit status of git with grep +git tag -v $last_tag > /dev/null 2>&1 +echo "" + +echo "Differences between tag $last_tag and what you are about to sign:" +PAGER=cat git diff $last_tag..master + +iter=1 +ok= +while test -z "$ok"; do + this_tag=$(date +${tagpfx}-%Y-%m-%d-v`printf "%02d" $iter`) + iter=`expr $iter + 1` + case `(echo $this_tag; echo $last_tag) | sort | tail -1` in + $last_tag) + ;; + $this_tag) + ok=yes + ;; + esac +done + +echo "" +echo "Using new tag $this_tag" +echo ONLY SIGN IF YOU APPROVE OF VERIFICATION AND DIFF ABOVE + +# GITTAGEXTRA is for putting things like "-u 2117364A" + +git tag $GITTAGEXTRA -m bump. -s $this_tag + +git push +git push --tags diff --git a/scripts/do-update.sh b/scripts/do-update.sh new file mode 100755 index 0000000..078ae15 --- /dev/null +++ b/scripts/do-update.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +cd /var/cache/entity-configurations_git.swamid.se && make update diff --git a/scripts/verify-tag b/scripts/verify-tag new file mode 100755 index 0000000..ddc3ff3 --- /dev/null +++ b/scripts/verify-tag @@ -0,0 +1,14 @@ +#!/bin/bash + +export GNUPGHOME=/etc/metadata/gnupg +mkdir -p $GNUPGHOME +export GPG=gpg + +git config --global gpg.program gpg + +tag=$(git tag -l "md-[0-9]*" | sort | tail -1) +if [ -z "$tag" ]; then + echo "no matching tag found" + exit 1 +fi +git checkout $tag && git tag -v $tag |