| |
@@ -30,21 +30,26 @@
|
| |
EOF
|
| |
}
|
| |
|
| |
- if ! [[ "${1}" =~ [31|32|33|34|35|36] ]];
|
| |
+ if ! [[ "${1}" =~ [34|35|36] ]];
|
| |
then
|
| |
ARCHES=("aarch64" "armhfp" "ppc64le" "s390x" "x86_64")
|
| |
else
|
| |
ARCHES=("aarch64" "ppc64le" "s390x" "x86_64")
|
| |
-
|
| |
fi
|
| |
+
|
| |
+ #Get the list of all the stable releases, this json file is manually updated by Fedora QA
|
| |
+ stable_releases=($(curl -s https://fedorapeople.org/groups/qa/metadata/release.json | jq -r '.[].stable[]'))
|
| |
# This is the release of Fedora that is currently stable, it will define if we
|
| |
# need to move the fedora:latest tag
|
| |
- current_stable="36"
|
| |
+ current_stable=${stable_releases[-1]}
|
| |
# Define what is rawhide so we know to push that tag
|
| |
- current_rawhide="37"
|
| |
+ current_rawhide="$(($current_stable+1))"
|
| |
+ # Define all the valid releases (stable_releases + rawhide),
|
| |
+ # it is used to validate the user input of this script
|
| |
+ valid_releases=(${stable_releases[@]} $current_rawhide)
|
| |
+
|
| |
# Sanity checking
|
| |
- # FIXME - Have to update this regex every time we drop a new Fedora Release
|
| |
- if ! [[ "${1}" =~ [31|32|33|34|35|36|37] ]];
|
| |
+ if ! [[ "${valid_releases[@]}" =~ "${1}" ]];
|
| |
then
|
| |
printf "ERROR: FEDORA_RELEASE missing or invalid\n"
|
| |
f_help
|
| |
@@ -71,14 +76,6 @@
|
| |
if [[ ${1} -eq "$current_rawhide" ]]; then
|
| |
tagname="rawhide"
|
| |
fi
|
| |
- #
|
| |
- # Version should not be higher than rawhide
|
| |
- # Either there is a mistake or script is out of date
|
| |
- #
|
| |
- if [[ ${1} -gt "$current_rawhide" ]]; then
|
| |
- printf "ERROR: VERSION HIGHER THAN RAWHIDE"
|
| |
- exit(1)
|
| |
- fi
|
| |
|
| |
minimal_build_name=$(koji -q latest-build --type=image f${1}-updates-candidate Fedora-Container-Minimal-Base | awk '{print $1}')
|
| |
if [[ -n ${build_name} ]]; then
|
| |
Instead of having to manually update this script every time we
GA a new release this change fetch the stable releases from a
json file maintained by Fedora QA.
We also use that info to validate the user input and exit the
script for any non valid Fedora release number.
Signed-off-by: Clement Verna cverna@tutanota.com