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:
parent
6c325811ed
commit
f5bfb22355
2 changed files with 17 additions and 6 deletions
|
|
@ -1,6 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euxo pipefail
|
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.
|
# Get OS details.
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
|
|
@ -14,15 +19,23 @@ fi
|
||||||
# Add osbuild team ssh keys.
|
# Add osbuild team ssh keys.
|
||||||
cat schutzbot/team_ssh_keys.txt | tee -a ~/.ssh/authorized_keys > /dev/null
|
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
|
sudo tee /etc/yum.repos.d/osbuild.repo << EOF
|
||||||
[osbuild]
|
[osbuild]
|
||||||
name=osbuild ${GIT_COMMIT}
|
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
|
enabled=1
|
||||||
gpgcheck=0
|
gpgcheck=0
|
||||||
# Default dnf repo priority is 99. Lower number means higher priority.
|
# Default dnf repo priority is 99. Lower number means higher priority.
|
||||||
priority=5
|
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
|
EOF
|
||||||
|
|
||||||
if [[ $ID == rhel ]]; then
|
if [[ $ID == rhel ]]; then
|
||||||
|
|
|
||||||
|
|
@ -65,14 +65,12 @@ greenprint "📤 RPMS will be uploaded to: ${REPO_URL}"
|
||||||
# Build source RPMs.
|
# Build source RPMs.
|
||||||
greenprint "🔧 Building source RPMs."
|
greenprint "🔧 Building source RPMs."
|
||||||
make srpm
|
make srpm
|
||||||
git clone --quiet https://github.com/osbuild/osbuild-composer osbuild-composer
|
|
||||||
make -C osbuild-composer srpm
|
|
||||||
|
|
||||||
# Compile RPMs in a mock chroot
|
# Compile RPMs in a mock chroot
|
||||||
greenprint "🎁 Building RPMs with mock"
|
greenprint "🎁 Building RPMs with mock"
|
||||||
sudo mock -r $MOCK_CONFIG --no-bootstrap-chroot \
|
sudo mock -r $MOCK_CONFIG --no-bootstrap-chroot \
|
||||||
--resultdir $REPO_DIR --with=tests \
|
--resultdir $REPO_DIR \
|
||||||
rpmbuild/SRPMS/*.src.rpm osbuild-composer/rpmbuild/SRPMS/*.src.rpm
|
rpmbuild/SRPMS/*.src.rpm
|
||||||
sudo chown -R $USER ${REPO_DIR}
|
sudo chown -R $USER ${REPO_DIR}
|
||||||
|
|
||||||
# Change the ownership of all of our repo files from root to our CI user.
|
# Change the ownership of all of our repo files from root to our CI user.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue