move routine before call

This commit is contained in:
Trevor Batley 2023-09-11 15:39:19 +10:00
parent 5dfc74d605
commit 557db9ba1e
2 changed files with 47 additions and 46 deletions

View File

@ -176,36 +176,6 @@ EOF
fi
# add builders
# if builders added as command line parameters, use those
if [ $KOJI_BUILD_FQDN ] ; then
for FQDN in ${KOJI_HUB_FQDN} ; do
deploy_builder $FQDN
done
else
# otherwise prompt for builders
echo "We will now deploy koji to your build servers"
MSG="Press <enter> to use your hub ($KOJI_HUB_FQDN), or enter the FQDN of your first build server) "
BSNO=1
while true ; do
read -p "Build Server FQDN: " FQDN
MSG="Add another Build Server (will stop asking if left blank) "
if [ -z $FQDN ] ; then
# if blank the first time add builder to the hub
if [[ $BSNO -gt 1 ]] ; then
break
else
FQDN=$KOJI_HUB_FQDN
fi
fi
deploy_builder $FQDN
((BSNO=BSNO+1))
done
fi
#
koji-bootstrap-build.sh
exit 0
deploy_builder () {
local FQDN=$1
# check if server available on port 22
@ -244,3 +214,32 @@ deploy_builder () {
# we found the server and will deploy to it
koji-add-builder.sh $FQDN $DEBUG
}
# if builders added as command line parameters, use those
if [ $KOJI_BUILD_FQDN ] ; then
for FQDN in ${KOJI_HUB_FQDN} ; do
deploy_builder $FQDN
done
else
# otherwise prompt for builders
echo "We will now deploy koji to your build servers"
MSG="Press <enter> to use your hub ($KOJI_HUB_FQDN), or enter the FQDN of your first build server) "
BSNO=1
while true ; do
read -p "Build Server FQDN: " FQDN
MSG="Add another Build Server (will stop asking if left blank) "
if [ -z $FQDN ] ; then
# if blank the first time add builder to the hub
if [[ $BSNO -gt 1 ]] ; then
break
else
FQDN=$KOJI_HUB_FQDN
fi
fi
deploy_builder $FQDN
((BSNO=BSNO+1))
done
fi
#
koji-bootstrap-build.sh

View File

@ -58,19 +58,21 @@ if [[ -n "$SRC_RPM_DIR" && -n "$BIN_RPM_DIR" ]]; then
rm -rf "$STAGING_RPM_DIR" "$HOME/.koji"
fi
sudo -u kojiadmin koji add-tag dist-"$TAG_NAME"
sudo -u kojiadmin koji edit-tag dist-"$TAG_NAME" -x mock.package_manager=dnf
for TAG in ${TAG_NAME} ; do
sudo -u kojiadmin koji add-tag dist-"$TAG"
sudo -u kojiadmin koji edit-tag dist-"$TAG" -x mock.package_manager=dnf
if [[ -n "$SRC_RPM_DIR" && -n "$BIN_RPM_DIR" ]]; then
sudo -u kojiadmin koji list-pkgs --quiet | xargs sudo -u kojiadmin koji add-pkg --owner kojiadmin dist-"$TAG_NAME"
sudo -u kojiadmin koji list-untagged | xargs -n 1 -P 100 sudo -u kojiadmin koji call tagBuildBypass dist-"$TAG_NAME" > /dev/null
sudo -u kojiadmin koji list-pkgs --quiet | xargs sudo -u kojiadmin koji add-pkg --owner kojiadmin dist-"$TAG"
sudo -u kojiadmin koji list-untagged | xargs -n 1 -P 100 sudo -u kojiadmin koji call tagBuildBypass dist-"$TAG" > /dev/null
fi
sudo -u kojiadmin koji add-tag --parent dist-"$TAG_NAME" --arches "$RPM_ARCH" dist-"$TAG_NAME"-build
sudo -u kojiadmin koji add-target dist-"$TAG_NAME" dist-"$TAG_NAME"-build
sudo -u kojiadmin koji add-group dist-"$TAG_NAME"-build build
sudo -u kojiadmin koji add-group dist-"$TAG_NAME"-build srpm-build
sudo -u kojiadmin koji add-group-pkg dist-"$TAG_NAME"-build build autoconf automake automake-dev binutils bzip2 clr-rpm-config coreutils cpio diffutils elfutils file gawk gcc gcc-dev gettext gettext-bin git glibc-dev glibc-locale glibc-utils grep gzip hostname libc6-dev libcap libtool libtool-dev linux-libc-headers m4 make netbase nss-altfiles patch pigz pkg-config pkg-config-dev rpm sed shadow systemd-lib tar unzip which xz
sudo -u kojiadmin koji add-group-pkg dist-"$TAG_NAME"-build srpm-build coreutils cpio curl-bin elfutils file git glibc-utils grep gzip make pigz plzip rpm sed shadow tar unzip wget xz
sudo -u kojiadmin koji add-tag --parent dist-"$TAG" --arches "$RPM_ARCH" dist-"$TAG"-build
sudo -u kojiadmin koji add-target dist-"$TAG" dist-"$TAG"-build
sudo -u kojiadmin koji add-group dist-"$TAG"-build build
sudo -u kojiadmin koji add-group dist-"$TAG"-build srpm-build
sudo -u kojiadmin koji add-group-pkg dist-"$TAG"-build build autoconf automake automake-dev binutils bzip2 clr-rpm-config coreutils cpio diffutils elfutils file gawk gcc gcc-dev gettext gettext-bin git glibc-dev glibc-locale glibc-utils grep gzip hostname libc6-dev libcap libtool libtool-dev linux-libc-headers m4 make netbase nss-altfiles patch pigz pkg-config pkg-config-dev rpm sed shadow systemd-lib tar unzip which xz
sudo -u kojiadmin koji add-group-pkg dist-"$TAG"-build srpm-build coreutils cpio curl-bin elfutils file git glibc-utils grep gzip make pigz plzip rpm sed shadow tar unzip wget xz
if [[ -n "$EXTERNAL_REPO" ]]; then
sudo -u kojiadmin koji add-external-repo -t dist-"$TAG_NAME"-build dist-"$TAG_NAME"-external-repo "$EXTERNAL_REPO"
sudo -u kojiadmin koji add-external-repo -t dist-"$TAG"-build dist-"$TAG"-external-repo "$EXTERNAL_REPO"
fi
sudo -u kojiadmin koji regen-repo dist-"$TAG_NAME"-build
sudo -u kojiadmin koji regen-repo dist-"$TAG"-build
done