Relax the requirements between osbuild-composer-tests and osbuild-composer

this is only useful for our RHEL nightly pipeline testing b/c we intend
to be building the -tests RPM from the main branch.
This commit is contained in:
Alexander Todorov 2021-12-08 13:12:30 +02:00 committed by Sanne Raymaekers
parent 3d86af796a
commit 570e5f595f
2 changed files with 20 additions and 0 deletions

View file

@ -2,6 +2,11 @@
# Pass --with tests to rpmbuild to override
%bcond_with tests
# When --with relax_requires is specified osbuild-composer-tests
# will require osbuild-composer only by name, excluding version/release
# This is used internally during nightly pipeline testing!
%bcond_with relax_requires
%global goipath github.com/osbuild/osbuild-composer
Version: 44
@ -371,7 +376,11 @@ The dnf-json binary used by osbuild-composer and the workers.
%package tests
Summary: Integration tests
%if %{with relax_requires}
Requires: %{name}
%else
Requires: %{name} = %{version}-%{release}
%endif
Requires: composer-cli
Requires: createrepo_c
Requires: xorriso

View file

@ -99,10 +99,15 @@ sudo mock -r "$MOCK_CONFIG" --buildsrpm \
--sources "./osbuild-composer-${COMMIT}.tar.gz" \
--resultdir ./srpm
if [ "${NIGHTLY:=false}" == "true" ]; then
RELAX_REQUIRES="--with=relax_requires"
fi
greenprint "🎁 Building RPMs"
sudo mock -r "$MOCK_CONFIG" \
--define "commit ${COMMIT}" \
--with=tests \
${RELAX_REQUIRES:+"$RELAX_REQUIRES"} \
--resultdir "$REPO_DIR" \
srpm/*.src.rpm
@ -112,6 +117,12 @@ sudo chown -R "$USER" "${REPO_DIR%%/*}"
greenprint "🧹 Remove logs from mock build"
rm "${REPO_DIR}"/*.log
# leave only -tests RPM to minimize interference when installing
# osbuild-composer.rpm from distro repositories
if [ "${NIGHTLY:=false}" == "true" ]; then
find "${REPO_DIR}" -type f -not -name "osbuild-composer-tests*.rpm" -exec rm -f "{}" \;
fi
# Create a repo of the built RPMs.
greenprint "⛓️ Creating dnf repository"
createrepo_c "${REPO_DIR}"