From 149859bdf010dd415453ac6d85ec92d5c9b7c344 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Mar 19 2024 21:55:13 +0000 Subject: More profiles, verbose is verbose --- diff --git a/docs/scripts/build_alt_images.sh b/docs/scripts/build_alt_images.sh index ebbfbef..351a2cd 100755 --- a/docs/scripts/build_alt_images.sh +++ b/docs/scripts/build_alt_images.sh @@ -10,10 +10,11 @@ DATETIME="$(date +%Y%m%d%H%M)" SOURCEGIT="https://pagure.io/centos-sig-alt-images/kiwi-descriptions.git" DESTGIT="https://gitlab.com/CentOS/AltImages/releng/kiwi-descriptions.git" # USER CHANGEABLE VARIABLES +VERBOSE="False" SCRATCH="True" WAIT="False" BRANCH="c9s" -PROFILE_LIST=("KDE-Live" "GNOME-Live" "MAX-Desktop") +PROFILE_LIST=("CINNAMON-Live" "GNOME-Live" "KDE-Live" "LUMINA-Live" "MATE-Live" "MAX-Live" "XFCE-Live") PROFILE_LIST_INFO=() ############### @@ -51,8 +52,10 @@ usage() { wait_for_sync() { source_hash=${1} Dest_Hash=$(git rev-parse HEAD) - # echo " Source Hash: ${source_hash}" - # echo " Dest Hash: ${Dest_Hash}" + if [ "${VERBOSE}" == "True" ] ; then + echo " Source Hash: ${source_hash}" + echo " Dest Hash: ${Dest_Hash}" + fi let count=1 while [ "${source_hash}" != "${Dest_Hash}" ] do @@ -60,6 +63,10 @@ wait_for_sync() { return 1 fi echo " git repos have not synced yet. Waiting a few minutes" + if [ "${VERBOSE}" == "True" ] ; then + echo " Source Hash: ${source_hash}" + echo " Dest Hash: ${Dest_Hash}" + fi if [ $count -ge 20 ] ; then echo " The git repos should have synced by now. Exiting." return 1 @@ -94,7 +101,7 @@ case $key in shift ;; -v | --verbose | --debug) - export VERBOSE="TRUE" + export VERBOSE="True" ;; -h | --help ) usage @@ -118,7 +125,9 @@ mkdir -p {source,dest} if git clone -q -b ${BRANCH} ${SOURCEGIT} source ; then pushd source > /dev/null Source_Hash=$(git rev-parse HEAD) - # echo " Source Hash: ${Source_Hash}" + if [ "${VERBOSE}" == "True" ] ; then + echo " Source Hash: ${Source_Hash}" + fi popd > /dev/null else echo "Failure - Branch was not found in Source git repo" @@ -131,18 +140,20 @@ else fi if git clone -q -b ${BRANCH} ${DESTGIT} dest ; then pushd dest > /dev/null - # wait_for_sync ${Source_Hash} - # Dest_Hash=$(git rev-parse HEAD) - # echo " Dest Hash: ${Dest_Hash}" - #if [ "${Source_Hash}" == "${Dest_Hash}" ] ; then if wait_for_sync ${Source_Hash} ; then echo " git repos are in sync" echo "Starting to build images" for profile in ${PROFILE_LIST[@]} do if [ "${SCRATCH}" == "True" ] ; then + if [ "${VERBOSE}" == "True" ] ; then + echo "cbs kiwi-build --nowait --scratch altimages9s-images-live-el9s git+${DESTGIT}#${Dest_Hash} CentOS-Stream-Alternative-Images.kiwi --type=iso --kiwi-profile=${profile} --release=0.n.${DATETIME}" + fi task_output="$(cbs kiwi-build --nowait --scratch altimages9s-images-live-el9s git+${DESTGIT}#${Dest_Hash} CentOS-Stream-Alternative-Images.kiwi --type=iso --kiwi-profile=${profile} --release=0.n.${DATETIME})" else + if [ "${VERBOSE}" == "True" ] ; then + echo "cbs kiwi-build --nowait altimages9s-images-live-el9s git+${DESTGIT}#${Dest_Hash} CentOS-Stream-Alternative-Images.kiwi --type=iso --kiwi-profile=${profile} --release=${DATETIME}" + fi task_output="$(cbs kiwi-build --nowait altimages9s-images-live-el9s git+${DESTGIT}#${Dest_Hash} CentOS-Stream-Alternative-Images.kiwi --type=iso --kiwi-profile=${profile} --release=${DATETIME})" fi task_id=$(echo "${task_output}" | grep "Created task:" | awk '{print $3}')