diff --git a/schutzbot/Jenkinsfile b/schutzbot/Jenkinsfile index 48cb077cb..04551dc96 100644 --- a/schutzbot/Jenkinsfile +++ b/schutzbot/Jenkinsfile @@ -138,10 +138,8 @@ pipeline { // don't build, use RPMs from the nightly trees sh "schutzbot/prepare-rhel-nightly.sh" stash ( - includes: 'osbuild-mock.repo', - // the name here matches the name in EL8 sections b/c - // they are executed unconditionally - name: 'rhel8' + includes: 'rhel8nightly.repo', + name: 'rhel8nightly' ) stash ( includes: 'rhel-8.json', @@ -630,6 +628,15 @@ pipeline { // Set up a function to hold the steps needed to run the tests so we don't // need to copy/paste the same lines over and over above. void run_tests(test_type) { + // unstash files but avoid failure if they don't exist + // b/c these files are available only for nightly builds + try { + unstash 'rhel8nightly' + unstash 'rhel8json' + unstash 'rhel8betajson' + } catch (err) { + echo "ERROR during unstash: ${err}" + } // Get CI machine details. sh ( diff --git a/schutzbot/deploy.sh b/schutzbot/deploy.sh index 266fac4b4..efd03ce19 100755 --- a/schutzbot/deploy.sh +++ b/schutzbot/deploy.sh @@ -86,6 +86,12 @@ if [[ "$PROJECT" != "osbuild-composer" ]]; then fi fi +if [ -f "rhel8nightly.repo" ]; then + greenprint "Preparing repos for nightly build testing" + sudo mv rhel8nightly.repo /etc/yum.repos.d/ + sudo rm -f /etc/yum.repos.d/osbuild*.repo +fi + greenprint "Installing test packages for ${PROJECT}" # Note: installing only -tests to catch missing dependencies retry sudo dnf -y install "${PROJECT}-tests" diff --git a/schutzbot/prepare-rhel-nightly.sh b/schutzbot/prepare-rhel-nightly.sh index 07df304e5..e8271de9b 100755 --- a/schutzbot/prepare-rhel-nightly.sh +++ b/schutzbot/prepare-rhel-nightly.sh @@ -13,22 +13,22 @@ COMPOSE_ID=$(cat COMPOSE_ID) # Create a repository file for installing the osbuild-composer RPMs greenprint "📜 Generating dnf repository file" -tee osbuild-mock.repo << EOF +tee rhel8nightly.repo << EOF [rhel8-nightly-baseos] name=${COMPOSE_ID} BaseOS baseurl=http://download.devel.redhat.com/rhel-8/nightly/RHEL-8/${COMPOSE_ID}/compose/BaseOS/${ARCH}/os enabled=1 gpgcheck=0 # Default dnf repo priority is 99. Lower number means higher priority. -priority=5 +priority=1 [rhel8-nightly-appstream] name=${COMPOSE_ID} AppStream baseurl=http://download.devel.redhat.com/rhel-8/nightly/RHEL-8/${COMPOSE_ID}/compose/AppStream/${ARCH}/os enabled=1 gpgcheck=0 -# Default dnf repo priority is 99. Lower number means higher priority. -priority=5 +# osbuild-composer repo priority is 5 +priority=1 EOF @@ -99,12 +99,12 @@ REPO_URL=${MOCK_REPO_BASE_URL}/${REPO_DIR_LATEST} # amend repository file. greenprint "📜 Amend dnf repository file" -tee -a osbuild-mock.repo << EOF -[osbuild-mock] -name=osbuild mock ${JOB_NAME} +tee -a rhel8nightly.repo << EOF +[osbuild-composer-tests] +name=Tests ${JOB_NAME} baseurl=${REPO_URL} enabled=1 gpgcheck=0 -# Default dnf repo priority is 99. Lower number means higher priority. -priority=5 +# osbuild-composer repo priority is 5 +priority=1 EOF diff --git a/tools/provision.sh b/tools/provision.sh index 1ed1e4478..c0d07d169 100755 --- a/tools/provision.sh +++ b/tools/provision.sh @@ -30,6 +30,15 @@ case "${ID}-${VERSION_ID}" in *) ;; esac +# overrides for RHEL nightly builds testing +if [ -f "rhel-8.json" ]; then + sudo mv rhel-8.json /etc/osbuild-composer/repositories/ +fi + +if [ -f "rhel-8-beta.json" ]; then + sudo mv rhel-8-beta.json /etc/osbuild-composer/repositories/ +fi + # Generate all X.509 certificates for the tests # The whole generation is done in a $CADIR to better represent how osbuild-ca # it.