From 0c6848f946962a97b7ce952050a818a54c5d3a17 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Tue, 30 Jun 2020 15:58:41 -0500 Subject: [PATCH] Use minimal images for RHEL mockbuild Now that we have minimal images built by osbuild-compsoer for CI, let's use those for RHEL mock builds. This PR depends on osbuild/osbuild-composer#808 to merge first. Signed-off-by: Major Hayden --- schutzbot/Jenkinsfile | 6 ++++-- schutzbot/mockbuild.sh | 13 +++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/schutzbot/Jenkinsfile b/schutzbot/Jenkinsfile index b893dcf35..e2f8b8796 100644 --- a/schutzbot/Jenkinsfile +++ b/schutzbot/Jenkinsfile @@ -64,7 +64,7 @@ pipeline { } } stage('RHEL 8 CDN') { - agent { label "rhel8" } + agent { label "rhel8cdn && minimal" } environment { AWS_CREDS = credentials('aws-credentials-osbuildci') } @@ -79,9 +79,11 @@ pipeline { } // NOTE(mhayden): RHEL 8.3 is only available in PSI for now. stage('RHEL 8.3 Nightly') { - agent { label "rhel83 && psi" } + agent { label "rhel83nightly && minimal" } environment { AWS_CREDS = credentials('aws-credentials-osbuildci') + NIGHTLY_REPO = credentials('rhel8-nightly-repo') + NIGHTLY_MOCK_TEMPLATE = credentials('rhel8-nightly-mock-template') } steps { sh "schutzbot/ci_details.sh" diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index 1a790cb03..537237ddb 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -16,6 +16,14 @@ sudo rm -f /etc/yum.repos.d/fedora*modular* # dnf operations. echo -e "fastestmirror=1\ninstall_weak_deps=0" | sudo tee -a /etc/dnf/dnf.conf +# Mock is only available in EPEL for RHEL. +if [[ $ID == rhel ]]; 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 + # Install requirements for building RPMs in mock. greenprint "📦 Installing mock requirements" sudo dnf -y install createrepo_c make mock rpm-build @@ -69,8 +77,9 @@ make -C osbuild srpm # Fix RHEL 8 mock template for non-subscribed images. if [[ $NODE_NAME == *rhel8[23]* ]]; then greenprint "📋 Updating RHEL 8 mock template for unsubscribed image" - sudo curl --retry 5 -Lsko /etc/mock/templates/rhel-8.tpl \ - https://gitlab.cee.redhat.com/snippets/2208/raw + sudo mv $NIGHTLY_MOCK_TEMPLATE /etc/mock/templates/rhel-8.tpl + cat $NIGHTLY_REPO | sudo tee -a /etc/mock/templates/rhel-8.tpl > /dev/null + echo '"""' | sudo tee -a /etc/mock/templates/rhel-8.tpl > /dev/null fi # Compile RPMs in a mock chroot