From 6a2cd25a07b2a9028da5a936834a8d619a84d0ba Mon Sep 17 00:00:00 2001 From: Jonathan Gonzalez V Date: Mon, 1 Jul 2024 12:10:00 +0200 Subject: [PATCH] ci: defer creating major `version` tag until release (#108) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Niccolò Fei Co-authored-by: Niccolò Fei --- .github/generate-strategy.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/generate-strategy.sh b/.github/generate-strategy.sh index b3d3b48c..4def4901 100755 --- a/.github/generate-strategy.sh +++ b/.github/generate-strategy.sh @@ -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