debian-forge-composer/schutzbot/deploy.sh
Tom Gundersen fe9f2c55b8 repositories/rhel-8: default to beta repos
The next release we are targeting is RHEL 8.3 Beta, switch the
repositories over.

In the future, we should distinguish between beta and non-beta based on
/etc/os-release so we don't have to hard-code this upstream.

The beta repositories are not actually available yet, so in our tests,
we have to override this again to point at the GA ones (currently 8.2).

Needless to say, this situation leaves much to be desired.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-29 16:04:38 +02:00

71 lines
No EOL
2.1 KiB
Bash
Executable file

#!/bin/bash
set -euxo pipefail
function retry {
local count=0
local retries=5
until "$@"; do
exit=$?
count=$(($count + 1))
if [[ $count -lt $retries ]]; then
echo "Retrying command..."
sleep 1
else
echo "Command failed after ${retries} retries. Giving up."
return $exit
fi
done
return 0
}
# Get OS details.
source /etc/os-release
# Restart systemd to work around some Fedora issues in cloud images.
sudo systemctl restart systemd-journald
# Add osbuild team ssh keys.
cat schutzbot/team_ssh_keys.txt | tee -a ~/.ssh/authorized_keys > /dev/null
# Set up a dnf repository for the RPMs we built via mock.
sudo cp osbuild-mock.repo /etc/yum.repos.d/osbuild-mock.repo
sudo dnf repository-packages osbuild-mock list
# Install the Image Builder packages.
# Note: installing only -tests to catch missing dependencies
retry sudo dnf -y install osbuild-composer-tests
# Copy the internal repositories into place when needed.
if curl -fs http://download.devel.redhat.com > /dev/null; then
# Set up a directory to hold repository overrides.
sudo mkdir -p /etc/osbuild-composer/repositories
case "${ID}${VERSION_ID}" in
fedora31)
sudo cp ${WORKSPACE}/test/internal-repos/fedora-31.json \
/etc/osbuild-composer/repositories/fedora-31.json
;;
fedora32)
sudo cp ${WORKSPACE}/test/internal-repos/fedora-32.json \
/etc/osbuild-composer/repositories/fedora-32.json
;;
rhel8.2)
sudo cp ${WORKSPACE}/test/external-repos/rhel-8.json \
/etc/osbuild-composer/repositories/rhel-8.json
;;
rhel8.3)
sudo cp ${WORKSPACE}/test/internal-repos/rhel-8.json \
/etc/osbuild-composer/repositories/rhel-8.json
;;
esac
fi
# Start services.
sudo systemctl enable --now osbuild-rcm.socket
sudo systemctl enable --now osbuild-composer.socket
# Verify that the API is running.
sudo composer-cli status show
sudo composer-cli sources list