Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

releng: koji-infratag-* scripts unified and support epel #3187

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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