Unstash rhel8nightly repo & json files

- even if they don't exist sometimes but ignore the errors
- make the nightly repository with a higher priority
- override rhel-8*.json files so that newly built images will
  also consume the nightly content
This commit is contained in:
Aleksandar Todorov 2020-11-17 15:14:16 +02:00 committed by Ondřej Budai
parent fb8493b4df
commit 4787fce3b7
4 changed files with 35 additions and 13 deletions

15
schutzbot/Jenkinsfile vendored
View file

@ -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 (

View file

@ -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"

View file

@ -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

View file

@ -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.