feat: generate a ClusterImageCatalog on image update (#97)

The image catalog YAML file will be committed an updated every time
an image is updated, thus, we provide a catalog with all the images in this repo.

Closes #96 

Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Co-authored-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
This commit is contained in:
Niccolò Fei
2024-04-22 15:35:55 +02:00
committed by GitHub
parent bdc6c6e374
commit 13c0eaf635
2 changed files with 91 additions and 9 deletions

View File

@@ -49,12 +49,13 @@ for version in "${debian_versions[@]}"; do
# Initial aliases are "major version", "optional alias", "full version with release"
# i.e. "14", "latest", "14.2-1", "14.2-debian","14.2"
fullTag="${postgresImageVersion}-${releaseVersion}"
versionAliases=(
"${version}"
${aliases[$version]:+"${aliases[$version]}"}
"${postgresImageVersion}-${releaseVersion}"
"${fullTag}"
"${postgresImageVersion}"
)
)
# Add all the version prefixes between full version and major version
# i.e "13.2"
while [ "$postgresImageVersion" != "$version" ] && [ "${postgresImageVersion%[.-]*}" != "$postgresImageVersion" ]; do
@@ -66,7 +67,7 @@ for version in "${debian_versions[@]}"; do
# Build the json entry
entries+=(
"{\"name\": \"Debian ${postgresImageVersion}\", \"platforms\": \"$platforms\", \"dir\": \"Debian/$version\", \"file\": \"Debian/$version/Dockerfile\", \"version\": \"$version\", \"tags\": [\"$(join "\", \"" "${versionAliases[@]}")\"]}"
"{\"name\": \"Debian ${postgresImageVersion}\", \"platforms\": \"$platforms\", \"dir\": \"Debian/$version\", \"file\": \"Debian/$version/Dockerfile\", \"version\": \"$version\", \"tags\": [\"$(join "\", \"" "${versionAliases[@]}")\"], \"fullTag\": \"${fullTag}\"}"
)
done