Skip to content

Commit 2ba0723

Browse files
committed
ci: generate a catalog including the full tag
Signed-off-by: Francesco Canovai <[email protected]>
1 parent 6a43c7a commit 2ba0723

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/generate-strategy.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@ for version in "${debian_versions[@]}"; do
4949

5050
# Initial aliases are "major version", "optional alias", "full version with release"
5151
# i.e. "14", "latest", "14.2-1", "14.2-debian","14.2"
52+
fullTag="${postgresImageVersion}-${releaseVersion}"
5253
versionAliases=(
5354
"${version}"
5455
${aliases[$version]:+"${aliases[$version]}"}
55-
"${postgresImageVersion}-${releaseVersion}"
56+
"${fullTag}"
5657
"${postgresImageVersion}"
57-
)
58+
)
5859
# Add all the version prefixes between full version and major version
5960
# i.e "13.2"
6061
while [ "$postgresImageVersion" != "$version" ] && [ "${postgresImageVersion%[.-]*}" != "$postgresImageVersion" ]; do
@@ -66,7 +67,7 @@ for version in "${debian_versions[@]}"; do
6667

6768
# Build the json entry
6869
entries+=(
69-
"{\"name\": \"Debian ${postgresImageVersion}\", \"platforms\": \"$platforms\", \"dir\": \"Debian/$version\", \"file\": \"Debian/$version/Dockerfile\", \"version\": \"$version\", \"tags\": [\"$(join "\", \"" "${versionAliases[@]}")\"]}"
70+
"{\"name\": \"Debian ${postgresImageVersion}\", \"platforms\": \"$platforms\", \"dir\": \"Debian/$version\", \"file\": \"Debian/$version/Dockerfile\", \"version\": \"$version\", \"tags\": [\"$(join "\", \"" "${versionAliases[@]}")\"], \"fullTag\": \"${fullTag}\"}"
7071
)
7172
done
7273

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
BASE_IMAGE=${IMAGE_RELEASE}
123123
fi
124124
125-
DIGEST=${BASE_IMAGE}@${{ steps.build.outputs.digest }} \
125+
IMAGE=${BASE_IMAGE}:${{ matrix.fullTag }}@${{ steps.build.outputs.digest }} \
126126
MAJOR=${{ matrix.version }} \
127127
yq --null-input '{
128128
"apiVersion": "postgresql.cnpg.io/v1",
@@ -132,7 +132,7 @@ jobs:
132132
"images": [
133133
{
134134
"major": env(MAJOR),
135-
"image": env(DIGEST)
135+
"image": env(IMAGE)
136136
}
137137
]
138138
}

0 commit comments

Comments
 (0)