From 7356bfb93ad7570bf8e39312c6885efe45e38a6b Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Fri, 15 Sep 2023 09:06:04 +1000 Subject: [PATCH] change install to be all-in-one with no parameters --- install-koji-farm.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/install-koji-farm.sh b/install-koji-farm.sh index c293df4..38f6f3f 100644 --- a/install-koji-farm.sh +++ b/install-koji-farm.sh @@ -5,7 +5,7 @@ DEBUG= KOJI_HUB_FQDN="$(hostname -f)" KOJI_WEB_FQDN=$KOJI_HUB_FQDN KOJI_BUILD_FQDNS= -for param in $1 $2 $3 $4 $5 $6 $7; do +for param in "$@"; do if [ $param ] ; then case $param in debug ) @@ -230,13 +230,11 @@ deploy_builder () { koji-add-builder.sh $FQDN $DEBUG } -# if builders added as command line parameters, use those -if [ $KOJI_BUILD_FQDNS ] ; then - for FQDN in ${KOJI_BUILD_FQDNS} ; do - deploy_builder $FQDN - done -else -# otherwise prompt for builders +if [ -z $KOJI_BUILD_FQDNS ] ; then + # use hub if no builders entered + deploy-builder $KOJI_HUB_FQDN +elif [ $KOJI_BUILD_FQDNS = "prompt" ] ; then + # prompt for builders echo "We will now deploy koji to your build servers" MSG="Press to use your hub ($KOJI_HUB_FQDN), or enter the FQDN of your first build server) " BSNO=1 @@ -254,6 +252,11 @@ else deploy_builder $FQDN ((BSNO=BSNO+1)) done +else + # use builders added as command line parameters + for FQDN in ${KOJI_BUILD_FQDNS} ; do + deploy_builder $FQDN + done fi # bootstrap the targets etc.