schutzbot: pin osbuild-composer

Pin the osbuild-composer that schutzbot runs a reverse dependency test
against. This allows to control which exact version to test against, and
ensures that PRs against osbuild always run against the same version.

Now that osbuild-composer's CI uploads RPMs to a predictable destination
(the same one that osbuild uses), we can use that instead of rebuilding
osbuild-composer on every CI run. This should speed up the mockbuild
stage considerably.

Pin it to v24 now.
This commit is contained in:
Lars Karlitski 2020-11-15 11:10:09 +01:00 committed by Tom Gundersen
parent 6c325811ed
commit f5bfb22355
2 changed files with 17 additions and 6 deletions

View file

@ -1,6 +1,11 @@
#!/bin/bash
set -euxo pipefail
DNF_REPO_BASEURL=http://osbuild-composer-repos.s3-website.us-east-2.amazonaws.com
# The osbuild-composer commit to run reverse-dependency test against.
OSBUILD_COMPOSER_COMMIT=692a8076bb4bf38dae05ce99631ebcdd3f0ab054
# Get OS details.
source /etc/os-release
ARCH=$(uname -m)
@ -14,15 +19,23 @@ fi
# Add osbuild team ssh keys.
cat schutzbot/team_ssh_keys.txt | tee -a ~/.ssh/authorized_keys > /dev/null
# Set up a dnf repository with the RPMs we want to test
# Set up dnf repositories with the RPMs we want to test
sudo tee /etc/yum.repos.d/osbuild.repo << EOF
[osbuild]
name=osbuild ${GIT_COMMIT}
baseurl=http://osbuild-composer-repos.s3-website.us-east-2.amazonaws.com/osbuild/${ID}-${VERSION_ID}/${ARCH}/${GIT_COMMIT}
baseurl=${DNF_REPO_BASEURL}/osbuild/${ID}-${VERSION_ID}/${ARCH}/${GIT_COMMIT}
enabled=1
gpgcheck=0
# Default dnf repo priority is 99. Lower number means higher priority.
priority=5
[osbuild-composer]
name=osbuild-composer ${OSBUILD_COMPOSER_COMMIT}
baseurl=${DNF_REPO_BASEURL}/osbuild-composer/${ID}-${VERSION_ID}/${ARCH}/${OSBUILD_COMPOSER_COMMIT}
enabled=1
gpgcheck=0
# Give this a slightly lower priority, because we used to have osbuild in this repo as well.
priority=10
EOF
if [[ $ID == rhel ]]; then

View file

@ -65,14 +65,12 @@ greenprint "📤 RPMS will be uploaded to: ${REPO_URL}"
# Build source RPMs.
greenprint "🔧 Building source RPMs."
make srpm
git clone --quiet https://github.com/osbuild/osbuild-composer osbuild-composer
make -C osbuild-composer srpm
# Compile RPMs in a mock chroot
greenprint "🎁 Building RPMs with mock"
sudo mock -r $MOCK_CONFIG --no-bootstrap-chroot \
--resultdir $REPO_DIR --with=tests \
rpmbuild/SRPMS/*.src.rpm osbuild-composer/rpmbuild/SRPMS/*.src.rpm
--resultdir $REPO_DIR \
rpmbuild/SRPMS/*.src.rpm
sudo chown -R $USER ${REPO_DIR}
# Change the ownership of all of our repo files from root to our CI user.