From 64432c706a90a6a4c79774e7e83de6f74a3b5e72 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Wed, 26 Aug 2020 20:25:09 +0100 Subject: [PATCH] schutzbot/mockbuild: test against osbuild in target release by default To make sure we test against what we will release with, use osbuild from the target distro rather than rebuilding it. The only exception is in RHEL8.3, where we are not rebasing any longer, but expect users who use new osbulid-composer from upstream to use it with new osbuild from upstream too. In this case, use the RPM from osbuild upstream, for now pinned to the same version as was in the submodule. This introduces a new configuration file: Schutzfile, which is meant to contain the full test-matrix. For now it only points to the upstream osbuild commit to add to the distro we are testing against (only relevant for 8.3). The submodule is now unused and is therefore removed. The produced repos now only contain osbuild-composer, osbuild is never built as part of osbuild-composer CI. Signed-off-by: Tom Gundersen --- Schutzfile | 9 +++++++++ schutzbot/deploy.sh | 17 +++++++++++++++++ schutzbot/mockbuild.sh | 3 +-- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 Schutzfile diff --git a/Schutzfile b/Schutzfile new file mode 100644 index 000000000..5672310d2 --- /dev/null +++ b/Schutzfile @@ -0,0 +1,9 @@ +{ + "rhel-8.3": { + "dependencies": { + "osbuild": { + "commit": "afafd46393e1c106e79c2412dbb5c4e45a05eda8" + } + } + } +} diff --git a/schutzbot/deploy.sh b/schutzbot/deploy.sh index 9e472f8e3..7604ae478 100755 --- a/schutzbot/deploy.sh +++ b/schutzbot/deploy.sh @@ -50,6 +50,23 @@ gpgcheck=0 priority=5 EOF +# TODO: include this in the jenkins runner (and split test/target machines out) +sudo dnf -y install jq + +OSBUILD_GIT_COMMIT=$(cat Schutzfile | jq -r '.["'"${ID}-${VERSION_ID}"'"].dependencies.osbuild.commit') +if [[ "${OSBUILD_GIT_COMMIT}" != "null" ]]; then + greenprint "Setting up a dnf repository with our unreleased osbuild depedency" + sudo tee /etc/yum.repos.d/osbuild.repo << EOF +[osbuild] +name=osbuild ${OSBUILD_GIT_COMMIT} +baseurl=http://osbuild-composer-repos.s3-website.us-east-2.amazonaws.com/osbuild/${ID}-${VERSION_ID}/${ARCH}/${OSBUILD_GIT_COMMIT} +enabled=1 +gpgcheck=0 +# Default dnf repo priority is 99. Lower number means higher priority. This repo may contain an old composer build, dump the priority. +priority=10 +EOF +fi + if [[ $ID == rhel ]]; then greenprint "Setting up EPEL repository" # we need this for ansible and koji diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index 43388f54f..8691d3995 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -66,12 +66,11 @@ greenprint "📤 RPMS will be uploaded to: ${REPO_URL}" # Build source RPMs. greenprint "🔧 Building source RPMs." make srpm -make -C osbuild srpm # Compile RPMs in a mock chroot greenprint "🎁 Building RPMs with mock" sudo mock -r "$MOCK_CONFIG" --resultdir "$REPO_DIR" --with=tests \ - rpmbuild/SRPMS/*.src.rpm osbuild/rpmbuild/SRPMS/*.src.rpm + rpmbuild/SRPMS/*.src.rpm # Change the ownership of all of our repo files from root to our CI user. sudo chown -R "$USER" "${REPO_DIR%%/*}"