smeserver-koji/koji-setup/koji-deploy-pungi-builder.sh

53 lines
1.1 KiB
Bash
Raw Normal View History

2024-11-14 00:58:43 +01:00
#!/bin/bash
# Copyright (C) 2024 Koozali Organisation
# SPDX-License-Identifier: Apache-2.0
set -e
DEBUG=
SILENT="-s"
QUIET="-q"
for param in $1 $2 ; do
if [ $param ] ; then
case $param in
debug )
DEBUG="debug" ;;
esac
else
break
fi
done
if [ $DEBUG ] ; then
set -xe
SILENT=
QUIET="-v"
fi
# load required parameters
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
if [ ! -f "$SCRIPT_DIR"/koji-parameters.sh ] ; then
echo "$SCRIPT_DIR/koji-parameters.sh NOT found - aborting"
exit 1
fi
source "$SCRIPT_DIR"/koji-parameters.sh
KOJI_BUILD_FQDN="$(hostname -f)"
# Install the koji builder components from epel
if [[ -z $(dnf list installed | grep koji-builder-plugins) ]] ; then
dnf install -y koji-builder-plugins $QUIET
fi
# deploy the central koji components
$SCRIPT_DIR/koji-deploy-pungi-hub.sh $DEBUG
# deploy runroot to the builders
if [ -z $KOJI_BUILD_FQDNS ] ; then
# use hub if no builders entered
$SCRIPT_DIR/koji-deply-pungi-builder.sh $KOJI_HUB_FQDN $DEBUG
else
# use builders from api call
for FQDN in ${KOJI_BUILD_FQDNS} ; do
$SCRIPT_DIR/koij-deploy-pungi-builder.sh $FQDN $DEBUG
done
fi