Skip to content

Commit

Permalink
releng: koji-infratag-* scripts unified and support epel
Browse files Browse the repository at this point in the history
  • Loading branch information
praiskup committed Mar 16, 2024
1 parent ac9ebba commit 7905cb7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 57 deletions.
44 changes: 0 additions & 44 deletions releng/koji-infratag-move-prod

This file was deleted.

1 change: 1 addition & 0 deletions releng/koji-infratag-move-prod
50 changes: 37 additions & 13 deletions releng/koji-infratag-staging
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,48 @@ die() { echo >&2 "FATAL: $*"; exit 1; }

test -n "$1" || { usage && exit 1 ; }

fedoras=
where_to=STAGE
case $(basename "$0") in
*move-prod)
where_to=PROD
;;
esac

distros=
for build; do
fedora_version=${build//*fc/}
case $fedora_version in
[0-9][0-9]) ;;
*) die "wrong fedora id '$fedora_version'" ;;

case $build in
*fc[0-9][0-9])
distro=f
distro_version=${build//*fc/}
;;
*el[0-9]|*el[0-9][0-9])
distro=epel
distro_version=${build//*el/}
;;
*) die "Unknown build: $build" ;;
esac

case $distro_version in
[0-9][0-9]|[0-9]) ;;
*) die "wrong $distro id '$distro_version'" ;;
esac

case $fedoras in
*" $fedora_version "*) ;; # already in
*) fedoras="$fedoras $fedora_version "
id=${distro}$distro_version
case $distros in
*" $id "*) ;; # already in
*) distros="$distros $id "
esac

eval "fedora_$fedora_version=\"\$fedora_$fedora_version $build\""
eval "distro_$id=\"\$distro_$id $build\""
done

for fedora in $fedoras; do
eval "builds=\$fedora_$fedora"
echo "Infra STG $fedora:$builds"
koji tag-build "f$fedora-infra-candidate" $builds
for distro in $distros; do
eval "builds=\$distro_$distro"
echo "Infra $where_to $distro -> $builds"
if test $where_to = STAGE; then
koji tag-build "$distro-infra-candidate" $builds
else
koji move "$distro"-infra-stg "$distro"-infra $builds
fi
done

0 comments on commit 7905cb7

Please sign in to comment.