File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,17 @@ POSTGRESQL_LATEST_MAJOR_RELEASE=16
20
20
21
21
# Get the last postgres base image tag and update time
22
22
fetch_postgres_image_version () {
23
- local suite =" $1 " ; shift
23
+ local version =" $1 " ; shift
24
24
local distro=" $1 " ; shift
25
25
local item=" $1 " ; shift
26
+
27
+ regexp=" ^${version} \\ .[0-9]+-${distro} $"
28
+ if [[ ${version} -gt " ${POSTGRESQL_LATEST_MAJOR_RELEASE} " ]]; then
29
+ regexp=" ^${version} beta[0-9]+-${distro} $"
30
+ fi
31
+
26
32
curl -SsL " https://registry.hub.docker.com/v2/repositories/library/postgres/tags/?name=${distro} &ordering=last_updated&page_size=50" | \
27
- jq -c " .results[] | select( .name | match(\" ^ ${suite} .[a-z0-9]+- ${distro} $ \" )) " | \
33
+ jq --arg regexp " $regexp " -c ' .results[] | select( .name | match($regexp)) ' | \
28
34
jq -r " .${item} " | \
29
35
head -n1
30
36
}
You can’t perform that action at this time.
0 commit comments