Skip to content

Commit

Permalink
select latest rawhide image without qa failures
Browse files Browse the repository at this point in the history
  • Loading branch information
gsauthof committed Dec 22, 2024
1 parent 443e3a8 commit 6829ef7
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions test/get-fedora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@ fi


if [ "$release" = rawhide ]; then
cid=$(curl -sSf https://kojipkgs.fedoraproject.org/compose/rawhide/latest-Fedora-Rawhide/COMPOSE_ID \
| grep '^Fedora-Rawhide-[0-9a-z.]\+$')
version=${cid#Fedora-Rawhide-}
img_url=https://kojipkgs.fedoraproject.org/compose/rawhide/latest-Fedora-Rawhide/compose/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-Rawhide-"$version".x86_64.qcow2
img=Fedora-Cloud-Base-Generic-Rawhide-"$version".x86_64.qcow2
img_url=$(curl -sSf https://openqa.fedoraproject.org/nightlies.html | awk -F '"' ' /^<a class="passedlink" href="https:\/\/kojipkgs\.fedoraproject\.org\/compose\/rawhide\/[^"]+\/Cloud\/x86_64\/images\/Fedora-Cloud-Base-Generic[^"]+"/ {print $4}' | grep '^[A-Za-z0-9.:/_-]\+$')

if [ "$img_url" ]; then
version=${img_url##*-}
version=${version%.x86_64.qcow2}
img=Fedora-Cloud-Base-Generic-Rawhide-"$version".x86_64.qcow2
else
# use latest available, in case QA results aren't available
cid=$(curl -sSf https://kojipkgs.fedoraproject.org/compose/rawhide/latest-Fedora-Rawhide/COMPOSE_ID \
| grep '^Fedora-Rawhide-[0-9a-z.]\+$')
version=${cid#Fedora-Rawhide-}
img_url=https://kojipkgs.fedoraproject.org/compose/rawhide/latest-Fedora-Rawhide/compose/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-Rawhide-"$version".x86_64.qcow2
img=Fedora-Cloud-Base-Generic-Rawhide-"$version".x86_64.qcow2
fi
else
latest=$(curl -sSf https://kojipkgs.fedoraproject.org/compose/cloud/ \
| awk -F'"' ' /latest-Fedora-Cloud-'"$release"'/ {
Expand Down

0 comments on commit 6829ef7

Please sign in to comment.