added release script

This commit is contained in:
Andreas Grapentin 2018-02-03 00:02:42 +01:00
parent 67c9dfd461
commit 5ccadc8f3b
No known key found for this signature in database
GPG Key ID: 7171986E4B745536
2 changed files with 53 additions and 1 deletions

@ -50,7 +50,7 @@ if [ -z "${NOBOOTSTRAP:-}" ]; then
./src/stage2.sh
else
# install a clean parabola-arm system in the empty image
# FIXME: add download link for released parabola tarballs here
wget -nc https://repo.parabola.nu/iso/arm/LATEST/$PARABOLATARBALL
TARBALL="$PARABOLATARBALL" ./src/stage1.sh
fi

52
release_tarball.sh Executable file

@ -0,0 +1,52 @@
#!/bin/bash
##############################################################################
# parabola-arm-imagebuilder #
# #
# Copyright (C) 2017 Andreas Grapentin #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
##############################################################################
set -eu
set -x
die() { echo "$*" 1>&2 ; exit 1; }
_tarball=$1
# parse date from tarball
_date=$(echo "${_tarball%.tar.gz}" | rev | cut -d'-' -f1-3 | rev)
# create checksums
sha512sum $_tarball > SHA512SUMS
whirlpool-hash $_tarball > WHIRLPOOLSUMS
# sign tarball and checksum
gpg --detach-sign $_tarball
gpg --detach-sign SHA512SUMS
gpg --detach-sign WHIRLPOOLSUMS
# upload tarball and checksum
_repopath="/srv/repo/main/iso/arm/$_date"
ssh repo@repo "mkdir -p $_repopath"
scp $_tarball{,.sig} SHA512SUMS{,.sig} WHIRLPOOLSUMS{,.sig} repo@repo:$_repopath/
# update LATEST symlinks
ssh repo@repo "mkdir -p $_repopath/../LATEST"
for f in $_tarball{,.sig} SHA512SUMS{,.sig} WHIRLPOOLSUMS{,.sig}; do
ssh repo@repo "ln -fs ../$_date/$f $_repopath/../LATEST/$(echo $f | sed "s/$_date/LATEST/g")"
done
# cleanup
rm -rf $_tarball.sig SHA512SUMS{,.sig} WHIRLPOOLSUMS{,.sig}