From 2a3b101709e2983da68e6ce7a74e70389eea3022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 20 Sep 2019 12:49:00 +0200 Subject: [PATCH] Fedora CI: Run mock on the current Fedora version (or 31 if less than 31) --- tests/mocktest.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/mocktest.sh b/tests/mocktest.sh index 5af4d83..2d1ed8a 100755 --- a/tests/mocktest.sh +++ b/tests/mocktest.sh @@ -1,12 +1,20 @@ #!/usr/bin/bash -eux +. /etc/os-release +fedora=$VERSION_ID -config="/tmp/fedora-rawhide-x86_64-ci.cfg" +# we don't have dynamic BuildRequires on Fedora 30 +# so we at least test that we can build in a Fedora 31 mock +if [ $fedora -lt 31 ]; then + fedora=31 +fi + +config="/tmp/fedora-${fedora}-x86_64-ci.cfg" # create mock config if not present # this makes sure tested version of pyproject-rpm-macros is available # TODO: check if it has precedence if the release was not bumped in tested PR if [ ! -f $config ]; then - original="/etc/mock/fedora-rawhide-x86_64.cfg" + original="/etc/mock/fedora-${fedora}-x86_64.cfg" split=$(sed -n '/\[fedora\]/=' $original | head -n1) head -n$(($split-1)) $original > $config cat /etc/yum.repos.d/test-pyproject-rpm-macros.repo >> $config @@ -29,7 +37,7 @@ mock -r $config --enablerepo=local ~/rpmbuild/SRPMS/${1}-*.src.rpm || res=$? # move the results to the artifacts directory, so we can examine them artifacts=${TEST_ARTIFACTS:-/tmp/artifacts} -pushd /var/lib/mock/fedora-rawhide-x86_64/result +pushd /var/lib/mock/fedora-*-x86_64/result mv *.rpm ${artifacts}/ || : for log in *.log; do mv ${log} ${artifacts}/${1}-${log}