From 8dfa7e146af5953b1e3380b97ef39c23fd769cd8 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 10 Sep 2018 15:51:20 +0200 Subject: [PATCH] add mkrelease.sh --- mkrelease.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 mkrelease.sh diff --git a/mkrelease.sh b/mkrelease.sh new file mode 100755 index 0000000..7ad9f31 --- /dev/null +++ b/mkrelease.sh @@ -0,0 +1,16 @@ +#!/bin/bash -ex + +JSON="$(realpath -e $1)" +BASEDIR="${JSON%/*}" + +IMAGE="${BASEDIR}/$(jq -r '.name' ${JSON})-$(jq -r '.version' ${JSON})" + +( + cd "$IMAGE" + [[ -f sha512sum.txt ]] || sha512sum * > sha512sum.txt + [[ -f sha512sum.txt.sig ]] || gpg2 --detach-sign sha512sum.txt +) + +if ! [[ -e "$IMAGE".tgz ]]; then + tar cf - -C "${IMAGE%/*}" "${IMAGE##*/}" | pigz -c > "$IMAGE".tgz +fi