chore: add support for PostgreSQL beta versions (#191)

Now bake supports beta versions for the list and the building of the images

Closes #190

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.
2025-05-23 15:14:49 +02:00
committed by GitHub
parent b1421da867
commit 23e1fa6181
2 changed files with 38 additions and 12 deletions

View File

@@ -20,6 +20,12 @@ now = timestamp()
authors = "The CloudNativePG Contributors"
url = "https://github.com/cloudnative-pg/postgres-containers"
extensions = [
"pgaudit",
"pgvector",
"pg-failover-slots"
]
target "default" {
matrix = {
tgt = [
@@ -31,7 +37,8 @@ target "default" {
"14.18",
"15.13",
"16.9",
"17.5"
"17.5",
"18~beta1"
]
base = [
// renovate: datasource=docker versioning=loose
@@ -45,17 +52,19 @@ target "default" {
"linux/arm64"
]
dockerfile = "Dockerfile"
name = "postgresql-${index(split(".",pgVersion),0)}-${tgt}-${distroVersion(base)}"
name = "postgresql-${index(split(".",cleanVersion(pgVersion)),0)}-${tgt}-${distroVersion(base)}"
tags = [
"${fullname}:${index(split(".",pgVersion),0)}-${tgt}-${distroVersion(base)}",
"${fullname}:${pgVersion}-${tgt}-${distroVersion(base)}",
"${fullname}:${pgVersion}-${formatdate("YYYYMMDDhhmm", now)}-${tgt}-${distroVersion(base)}"
"${fullname}:${index(split(".",cleanVersion(pgVersion)),0)}-${tgt}-${distroVersion(base)}",
"${fullname}:${cleanVersion(pgVersion)}-${tgt}-${distroVersion(base)}",
"${fullname}:${cleanVersion(pgVersion)}-${formatdate("YYYYMMDDhhmm", now)}-${tgt}-${distroVersion(base)}"
]
context = "."
target = "${tgt}"
args = {
PG_VERSION = "${pgVersion}"
PG_MAJOR = "${getMajor(pgVersion)}"
BASE = "${base}"
EXTENSIONS = "${getExtensionsString(pgVersion, extensions)}"
}
attest = [
"type=provenance,mode=max",
@@ -107,3 +116,23 @@ function digest {
params = [ imageNameWithSha ]
result = index(split("@", imageNameWithSha), 1)
}
function cleanVersion {
params = [ version ]
result = replace(version, "~", "")
}
function isBeta {
params = [ version ]
result = length(regexall("[0-9]+~beta.*", version)) > 0
}
function getMajor {
params = [ version ]
result = (isBeta(version) == true) ? index(split("~", version),0) : index(split(".", version),0)
}
function getExtensionsString {
params = [ version, extensions ]
result = (isBeta(version) == true) ? "" : join(" ", formatlist("postgresql-%s-%s", getMajor(version), extensions))
}