diff --git a/schutzbot/deploy.sh b/schutzbot/deploy.sh index 34e1b33..9ea9311 100755 --- a/schutzbot/deploy.sh +++ b/schutzbot/deploy.sh @@ -20,8 +20,8 @@ function retry { # Variables for where to find osbuild-composer RPMs to test against DNF_REPO_BASEURL=http://osbuild-composer-repos.s3-website.us-east-2.amazonaws.com -OSBUILD_COMMIT=3086c7d70c304214e2855cdcf495d4b70f4b04c6 # release 26 -OSBUILD_COMPOSER_COMMIT=8ca6b1ea157183ff88594ac1b06af1c28d8e0a2c # release 28 +OSBUILD_COMMIT=35de3093a7b52569512bdc61d2105febbb9b0c7e # release 30 +OSBUILD_COMPOSER_COMMIT=b5987a5ca51826f29a3bce742d693a55f16f016f # commit newer than release 30 (we need one with rhel-8-cdn) # Get OS details. source /etc/os-release @@ -46,11 +46,21 @@ echo -e "fastestmirror=1" | sudo tee -a /etc/dnf/dnf.conf # Add osbuild team ssh keys. cat schutzbot/team_ssh_keys.txt | tee -a ~/.ssh/authorized_keys > /dev/null +# Distro version in whose buildroot was the RPM built. +DISTRO_VERSION=${ID}-${VERSION_ID} + +if [[ "$ID" == rhel ]] && sudo subscription-manager status; then + # If this script runs on a subscribed RHEL, the RPMs are actually built + # using the latest CDN content, therefore rhel-*-cdn is used as the distro + # version. + DISTRO_VERSION=rhel-${VERSION_ID%.*}-cdn +fi + # Set up dnf repositories with the RPMs we want to test sudo tee /etc/yum.repos.d/osbuild.repo << EOF [koji-osbuild] name=koji-osbuild ${GIT_COMMIT} -baseurl=${DNF_REPO_BASEURL}/koji-osbuild/${ID}-${VERSION_ID}/${ARCH}/${GIT_COMMIT} +baseurl=${DNF_REPO_BASEURL}/koji-osbuild/${DISTRO_VERSION}/${ARCH}/${GIT_COMMIT} enabled=1 gpgcheck=0 # Default dnf repo priority is 99. Lower number means higher priority. @@ -58,7 +68,7 @@ priority=5 [osbuild] name=osbuild ${OSBUILD_COMMIT} -baseurl=${DNF_REPO_BASEURL}/osbuild/${ID}-${VERSION_ID}/${ARCH}/${OSBUILD_COMMIT} +baseurl=${DNF_REPO_BASEURL}/osbuild/${DISTRO_VERSION}/${ARCH}/${OSBUILD_COMMIT} enabled=1 gpgcheck=0 # Default dnf repo priority is 99. Lower number means higher priority. @@ -66,7 +76,7 @@ priority=5 [osbuild-composer] name=osbuild-composer ${OSBUILD_COMPOSER_COMMIT} -baseurl=${DNF_REPO_BASEURL}/osbuild-composer/${ID}-${VERSION_ID}/${ARCH}/${OSBUILD_COMPOSER_COMMIT} +baseurl=${DNF_REPO_BASEURL}/osbuild-composer/${DISTRO_VERSION}/${ARCH}/${OSBUILD_COMPOSER_COMMIT} enabled=1 gpgcheck=0 # Default dnf repo priority is 99. Lower number means higher priority. diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index 1811b5a..3521e43 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -29,9 +29,19 @@ REPO_BUCKET=osbuild-composer-repos # Public URL for the S3 bucket with our artifacts. MOCK_REPO_BASE_URL="http://${REPO_BUCKET}.s3-website.us-east-2.amazonaws.com" +# Distro version in whose buildroot was the RPM built. +DISTRO_VERSION=${ID}-${VERSION_ID} + +if [[ "$ID" == rhel ]] && sudo subscription-manager status; then + # If this script runs on a subscribed RHEL, the RPMs are actually built + # using the latest CDN content, therefore rhel-*-cdn is used as the distro + # version. + DISTRO_VERSION=rhel-${VERSION_ID%.*}-cdn +fi + # Relative path of the repository – used for constructing both the local and # remote paths below, so that they're consistent. -REPO_PATH=koji-osbuild/${ID}-${VERSION_ID}/${ARCH}/${GIT_SHA} +REPO_PATH=koji-osbuild/${DISTRO_VERSION}/${ARCH}/${GIT_SHA} # Directory to hold the RPMs temporarily before we upload them. REPO_DIR=repo/${REPO_PATH}