From 022270989c09dc1474fa771d9e65f333d16336b4 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 28 May 2022 18:07:40 +0200 Subject: build-all: added -t/--test as a test mode --- build-all | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'build-all') diff --git a/build-all b/build-all index dd647d3..22df715 100755 --- a/build-all +++ b/build-all @@ -59,6 +59,7 @@ usage() { >&2 echo "possible options:" >&2 echo " -h|--help: show this help and exit." >&2 echo " -f|--force: overwrite already existing artifacts (use with care!)." + >&2 echo " -t|--test: test mode, generate artifacts, but don't pusblish anything." [ -z "$1" ] && exit 1 || exit "$1" } @@ -76,20 +77,25 @@ cleanup() { trap cleanup EXIT eval set -- "$( - getopt -o hf \ + getopt -o hft \ --long force \ + --long test \ --long help \ -n "$(basename "$0")" -- "$@" || \ echo usage )" force=0 +testmode=0 while [ $# -gt 0 ]; do case "$1" in '--force'|'-f') force=1 ;; + '--test'|'-t') + testmode=1 + ;; '--help'|'-h') usage 0 ;; @@ -202,9 +208,11 @@ else fi # update web page for isos and download mirrors -echo "Updating website.." -git -C "${WEBSITE_DIR}" reset --hard -git -C "${WEBSITE_DIR}" pull --ff-only +if [ $testmode = 0 ]; then + echo "Updating website.." + git -C "${WEBSITE_DIR}" reset --hard + git -C "${WEBSITE_DIR}" pull --ff-only +fi "${base_dir}/update-website" \ --website-dir="${WEBSITE_DIR}" \ --mirror-dir="${MIRROR_DIR}" \ @@ -213,8 +221,10 @@ git -C "${WEBSITE_DIR}" pull --ff-only --update-mirrors \ --torrent-seed="https://pool.mirror.archlinux32.org/archisos/archlinux32-${DATE}-${ARCH}.iso.torrent" \ --magnet-link="${magnet_link}" -git -C "${WEBSITE_DIR}" commit 'download/index.html' -m 'download/index.html: new isos ('"${DATE}"')' -git -C "${WEBSITE_DIR}" push +if [ $testmode = 0 ]; then + git -C "${WEBSITE_DIR}" commit 'download/index.html' -m 'download/index.html: new isos ('"${DATE}"')' + git -C "${WEBSITE_DIR}" push +fi # when did we last updates the date +%s > "${ARCHISOS_DIR}/lastupdate" -- cgit v1.2.3-70-g09d2