Rather than using the arbitrary port 8701, use the standard 443. The worker API will remain on a separate port, and as long as the two APIs are exposed by the same binary that will have to remain separate at 8700. Move the test instance of koji on localhost from 443 to 4343, to avoid a conflict. In a follow-up we should also give this API a prefix, so the cloud API can share the same port with it. Signed-off-by: Tom Gundersen <teg@jklm.no>
87 lines
2.5 KiB
Bash
Executable file
87 lines
2.5 KiB
Bash
Executable file
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
# Get OS data.
|
|
source /etc/os-release
|
|
ARCH=$(uname -m)
|
|
|
|
# Colorful output.
|
|
function greenprint {
|
|
echo -e "\033[1;32m${1}\033[0m"
|
|
}
|
|
|
|
if [[ $ID == rhel ]] && ! rpm -q epel-release; then
|
|
greenprint "📦 Setting up EPEL repository"
|
|
curl -Ls --retry 5 --output /tmp/epel.rpm \
|
|
https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
|
|
sudo rpm -Uvh /tmp/epel.rpm
|
|
fi
|
|
|
|
greenprint "Installing required packages"
|
|
sudo dnf -y install \
|
|
container-selinux \
|
|
dnsmasq \
|
|
krb5-workstation \
|
|
koji \
|
|
podman \
|
|
python3 \
|
|
sssd-krb5
|
|
|
|
if [[ $ID == rhel ]]; then
|
|
greenprint "Tweaking podman, maybe."
|
|
sudo cp schutzbot/vendor/87-podman-bridge.conflist /etc/cni/net.d/
|
|
sudo cp schutzbot/vendor/dnsname /usr/libexec/cni/
|
|
fi
|
|
|
|
greenprint "Starting containers"
|
|
sudo ./internal/upload/koji/run-koji-container.sh start
|
|
|
|
greenprint "Copying custom composer/worker config"
|
|
sudo mkdir -p /etc/osbuild-composer
|
|
sudo cp test/image-tests/osbuild-composer.toml \
|
|
/etc/osbuild-composer/
|
|
sudo mkdir -p /etc/osbuild-worker
|
|
sudo cp test/image-tests/osbuild-worker.toml \
|
|
/etc/osbuild-worker/
|
|
|
|
greenprint "Adding kerberos config"
|
|
sudo cp \
|
|
/tmp/osbuild-composer-koji-test/client.keytab \
|
|
/etc/osbuild-composer/client.keytab
|
|
sudo cp \
|
|
/tmp/osbuild-composer-koji-test/client.keytab \
|
|
/etc/osbuild-worker/client.keytab
|
|
sudo cp \
|
|
test/image-tests/krb5-local.conf \
|
|
/etc/krb5.conf.d/local
|
|
|
|
greenprint "Adding generated CA cert for Koji"
|
|
sudo cp \
|
|
/tmp/osbuild-composer-koji-test/ca-crt.pem \
|
|
/etc/pki/ca-trust/source/anchors/koji-ca-crt.pem
|
|
sudo update-ca-trust
|
|
|
|
greenprint "Restarting composer to pick up new config"
|
|
sudo systemctl restart osbuild-composer
|
|
sudo systemctl restart osbuild-worker\@1
|
|
|
|
greenprint "Testing Koji"
|
|
koji --server=http://localhost:8080/kojihub --user=osbuild --password=osbuildpass --authtype=password hello
|
|
|
|
greenprint "Creating Koji task"
|
|
koji --server=http://localhost:8080/kojihub --user kojiadmin --password kojipass --authtype=password make-task image
|
|
|
|
greenprint "Pushing compose to Koji"
|
|
sudo ./test/image-tests/koji-compose.py "${ID}-${VERSION_ID%.*}"
|
|
|
|
greenprint "Show Koji task"
|
|
koji --server=http://localhost:8080/kojihub taskinfo 1
|
|
koji --server=http://localhost:8080/kojihub buildinfo 1
|
|
|
|
greenprint "Stopping containers"
|
|
sudo ./internal/upload/koji/run-koji-container.sh stop
|
|
|
|
greenprint "Removing generated CA cert"
|
|
sudo rm \
|
|
/etc/pki/ca-trust/source/anchors/koji-ca-crt.pem
|
|
sudo update-ca-trust
|