#14 Fedora CI: Run mock on the current Fedora version (or 31 if less than 31)
Merged 20 days ago by churchyard. Opened 23 days ago by churchyard.
rpms/ churchyard/pyproject-rpm-macros native_ci  into  master

file modified
+11 -3

@@ -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 @@ 

  

  # 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}

rebased onto 06e167a

23 days ago

Metadata Update from @churchyard:
- Request assigned

23 days ago

Metadata Update from @churchyard:
- Request assignee reset

23 days ago

I would prefer "source" due to readability, but that's just a pet peeve.

I would test the fedora variable instead of $VERSION_ID, in case there's some chaining of ifs in the future.

Besides these suggestions, LGTM.

I would prefer "source" due to readability, but that's just a pet peeve.

I decided to ignore this. . is the POSIX-standard command for executing commands from a file; source is a more-readable synonym provided by bash.

I would test the fedora variable instead of $VERSION_ID, in case there's some chaining of ifs in the future.

Done.

rebased onto 2a3b101

20 days ago

I would prefer "source" due to readability, but that's just a pet peeve.

I decided to ignore this. . is the POSIX-standard command for executing commands from a file; source is a more-readable synonym provided by bash.

Ah, I see, makes sense.

Pull-Request has been merged by churchyard

20 days ago