ci: defer creating major version tag until release (#108)

Previously, we were always setting the `version` tag (e.g., 16, 17) when building
a container image. However, version 17 is still in beta and was tagged with `17`,
which could cause confusion. Users might mistake it for a stable release,
and tools like Renovate might attempt to update to this version.

This change ensures that the major `version` tag is not created until the version
is officially released.

Signed-off-by: Jonathan Gonzalez V <jonathan.gonzalez@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Co-authored-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
This commit is contained in:
Jonathan Gonzalez V
2024-07-01 12:10:00 +02:00
committed by GitHub
parent baa64fff56
commit 6a2cd25a07

View File

@@ -8,9 +8,12 @@
#
set -eu
ROOT_DIR=$(cd "$(dirname "$0")/../"; pwd)
source "${ROOT_DIR}/lib/repo_funcs.sh"
# Define an optional aliases for some major versions
declare -A aliases=(
[16]='latest'
[$POSTGRESQL_LATEST_MAJOR_RELEASE]='latest'
)
# Define the current default distribution
@@ -66,13 +69,18 @@ generator() {
# Additional aliases in case we are running in the default distro
# i.e. "14", "14.2", "14.2-1", "latest"
if [ "${distro}" == "${DEFAULT_DISTRO}" ]; then
if [[ "${distro}" == "${DEFAULT_DISTRO}" ]]; then
versionAliases+=(
"$version"
"${postgresImageVersion}"
"${postgresImageVersion}-${releaseVersion}"
${aliases[$version]:+"${aliases[$version]}"}
)
# Create a tag with just the major (e.g "14") only for stable versions
if [[ "${version}" -le "${POSTGRESQL_LATEST_MAJOR_RELEASE}" ]]; then
versionAliases+=(
"$version"
)
fi
fi
# Supported platforms for container images