Skip to content
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
31 changes: 19 additions & 12 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ update_version()
fullVersion=1:${mariaVersion}+maria~${suffix[${suite}]}

if [[ $version = 10.[234] ]]; then
arches=" amd64 arm64v8 ppc64le"
arches="amd64 arm64v8 ppc64le"
else
arches=" amd64 arm64v8 ppc64le s390x"
arches="amd64 arm64v8 ppc64le s390x"
fi

cp Dockerfile.template "$version/Dockerfile"
Expand All @@ -53,7 +53,7 @@ update_version()
-e 's!%%MARIADB_RELEASE_STATUS%%!'"$releaseStatus"'!g' \
-e 's!%%MARIADB_SUPPORT_TYPE%%!'"$supportType"'!g' \
-e 's!%%SUITE%%!'"$suite"'!g' \
-e 's!%%ARCHES%%!'"$arches"'!g' \
-e 's!%%ARCHES%%! '"$arches"'!g' \
"$version/Dockerfile"

# Start using the new executable names
Expand Down Expand Up @@ -94,41 +94,48 @@ update_version()
fi
;&
esac

# Add version to versions.json
versionJson="$(jq -e \
--arg milestone "$version" --arg version "$mariaVersion" --arg fullVersion "$fullVersion" --arg releaseStatus "$releaseStatus" --arg supportType "$supportType" --arg base "ubuntu:$suite" --arg arches "$arches" \
'.[$milestone] = {"milestone": $milestone, "version": $version, "fullVersion": $fullVersion, "releaseStatus": $releaseStatus, "supportType": $supportType, "base": $base, "arches": $arches|split(" ")}' versions.json)"
printf '%s\n' "$versionJson" > versions.json
}

update_version_array()
{
c0=$(( $1 - 2 ))
c1=$(( $1 - 1 ))
version=${release[$c0]//\"}
version=${release[$c0]}
if [ ! -d "$version" ]; then
echo >&2 "warning: no rule for $version"
return
fi
mariaversion

releaseStatus=${release[$c1]//\"}
releaseStatus=${release[$c1]}

case "$releaseStatus" in
Alpha | Beta | Gamma | RC | Stable ) ;; # sanity check
*) echo >&2 "error: unexpected 'release status' value for $mariaVersion: $releaseStatus"; ;;
esac

supportType=${2//\"}
supportType=$2

update_version
}

mariaversion() {
mariaVersion=$(curl -fsSL "$DOWNLOADS_REST_API/mariadb/${version}" |
jq 'first(..|select(.release_id)) | .release_id')
mariaVersion=${mariaVersion//\"/}
jq -r 'first(.releases[]).release_id')
}

all()
{
printf '%s\n' "{}" > versions.json

readarray -O 0 -c 3 -C update_version_array -t release <<< "$(curl -fsSL "$DOWNLOADS_REST_API/mariadb/" \
| jq '.major_releases[] | [ .release_id ], [ .release_status ], [ .release_support_type ] | @tsv ')"
| jq -r '.major_releases[] | [ .release_id ], [ .release_status ], [ .release_support_type ] | @tsv')"
}

development_version=11.2
Expand Down Expand Up @@ -163,9 +170,9 @@ for version in "${versions[@]}"; do
mariaversion
fi
readarray -t release <<< "$(curl -fsSL "$DOWNLOADS_REST_API/mariadb/" \
| jq ".major_releases[] | select(.release_id == \"$version\") | [ .release_status ] , [ .release_support_type ] | @tsv")"
releaseStatus=${release[0]//\"}
supportType=${release[1]//\"}
| jq -r --arg version "$version" '.major_releases[] | select(.release_id == $version) | [ .release_status ] , [ .release_support_type ] | @tsv')"
releaseStatus=${release[0]}
supportType=${release[1]}

update_version
done
127 changes: 127 additions & 0 deletions versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"11.1": {
"milestone": "11.1",
"version": "11.1.1",
"fullVersion": "1:11.1.1+maria~ubu2204",
"releaseStatus": "RC",
"supportType": "Short Term Support",
"base": "ubuntu:jammy",
"arches": [
"amd64",
"arm64v8",
"ppc64le",
"s390x"
]
},
"11.0": {
"milestone": "11.0",
"version": "11.0.2",
"fullVersion": "1:11.0.2+maria~ubu2204",
"releaseStatus": "Stable",
"supportType": "Short Term Support",
"base": "ubuntu:jammy",
"arches": [
"amd64",
"arm64v8",
"ppc64le",
"s390x"
]
},
"10.11": {
"milestone": "10.11",
"version": "10.11.4",
"fullVersion": "1:10.11.4+maria~ubu2204",
"releaseStatus": "Stable",
"supportType": "Long Term Support",
"base": "ubuntu:jammy",
"arches": [
"amd64",
"arm64v8",
"ppc64le",
"s390x"
]
},
"10.10": {
"milestone": "10.10",
"version": "10.10.5",
"fullVersion": "1:10.10.5+maria~ubu2204",
"releaseStatus": "Stable",
"supportType": "Short Term Support",
"base": "ubuntu:jammy",
"arches": [
"amd64",
"arm64v8",
"ppc64le",
"s390x"
]
},
"10.9": {
"milestone": "10.9",
"version": "10.9.7",
"fullVersion": "1:10.9.7+maria~ubu2204",
"releaseStatus": "Stable",
"supportType": "Short Term Support",
"base": "ubuntu:jammy",
"arches": [
"amd64",
"arm64v8",
"ppc64le",
"s390x"
]
},
"10.6": {
"milestone": "10.6",
"version": "10.6.14",
"fullVersion": "1:10.6.14+maria~ubu2004",
"releaseStatus": "Stable",
"supportType": "Long Term Support",
"base": "ubuntu:focal",
"arches": [
"amd64",
"arm64v8",
"ppc64le",
"s390x"
]
},
"10.5": {
"milestone": "10.5",
"version": "10.5.21",
"fullVersion": "1:10.5.21+maria~ubu2004",
"releaseStatus": "Stable",
"supportType": "Long Term Support",
"base": "ubuntu:focal",
"arches": [
"amd64",
"arm64v8",
"ppc64le",
"s390x"
]
},
"10.4": {
"milestone": "10.4",
"version": "10.4.30",
"fullVersion": "1:10.4.30+maria~ubu2004",
"releaseStatus": "Stable",
"supportType": "Long Term Support",
"base": "ubuntu:focal",
"arches": [
"amd64",
"arm64v8",
"ppc64le"
]
},
"11.2": {
"milestone": "11.2",
"version": "11.2.0",
"fullVersion": "1:11.2.0+maria~ubu2204",
"releaseStatus": "Alpha",
"supportType": "Unknown",
"base": "ubuntu:jammy",
"arches": [
"amd64",
"arm64v8",
"ppc64le",
"s390x"
]
}
}