diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ab2c42..44acc9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- [#62] Update PostgreSQL to 17.6 +- [#62] Update Makefiles to 10.2.1 +- [#62] Update base image to 3.22.0-4 ## [v14.18-2] - 2025-08-25 ### Fixed diff --git a/Dockerfile b/Dockerfile index cce9584..9ec5153 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.cloudogu.com/official/base:3.18.9-3 AS builder +FROM registry.cloudogu.com/official/base:3.22.0-4 AS builder ENV GOSU_SHA256=bbc4136d03ab138b1ad66fa4fc051bafc6cc7ffae632b069a53657279a450de3 @@ -15,22 +15,22 @@ RUN set -x -o errexit \ && echo "${GOSU_SHA256} */build/usr/local/bin/gosu" | sha256sum -c - \ && chmod +x /build/usr/local/bin/gosu -FROM registry.cloudogu.com/official/base:3.18.9-3 +FROM registry.cloudogu.com/official/base:3.22.0-4 LABEL NAME="official/postgresql" \ - VERSION="14.18-2" \ + VERSION="17.6-0" \ maintainer="hello@cloudogu.com" ENV LANG=en_US.utf8 \ PGDATA=/var/lib/postgresql \ - POSTGRESQL_VERSION=14.18-r0 + POSTGRESQL_VERSION=17.6-r0 RUN set -x -o errexit \ && set -o nounset \ && set -o pipefail \ && apk update \ && apk upgrade \ - && apk add --no-cache --update postgresql14="${POSTGRESQL_VERSION}" postgresql14-contrib="${POSTGRESQL_VERSION}" + && apk add --no-cache --update postgresql17="${POSTGRESQL_VERSION}" postgresql17-contrib="${POSTGRESQL_VERSION}" COPY resources/ / COPY --from=builder /build / diff --git a/Makefile b/Makefile index dd97f2d..1994eb3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -MAKEFILES_VERSION=10.2.0 +MAKEFILES_VERSION=10.2.1 .DEFAULT_GOAL:=dogu-release @@ -7,4 +7,4 @@ include build/make/self-update.mk include build/make/release.mk include build/make/bats.mk include build/make/k8s-dogu.mk -include build/make/prerelease.mk \ No newline at end of file +include build/make/prerelease.mk diff --git a/dogu.json b/dogu.json index a97a4ec..67de96e 100644 --- a/dogu.json +++ b/dogu.json @@ -1,6 +1,6 @@ { "Name": "official/postgresql", - "Version": "14.18-2", + "Version": "17.6-0", "DisplayName": "PostgreSQL", "Description": "PostgreSQL Database.", "Url": "https://www.postgresql.org/", diff --git a/resources/post-upgrade.sh b/resources/post-upgrade.sh index 643c53a..518be8c 100755 --- a/resources/post-upgrade.sh +++ b/resources/post-upgrade.sh @@ -70,6 +70,43 @@ function reindexAllDatabases() { reindexdb -U postgres --verbose --all } +function assertVersionFormat() { + if [[ "${1}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-[0-9]+$ ]]; then + return 0 + else + echo >&2 "invalid version format: ${1}" + exit 1 + fi +} + +function versionXGreaterOrEqualThanY() { + assertVersionFormat "${1}" + assertVersionFormat "${2}" + local a="${1%%-*}" + local b="${2%%-*}" + local smallest="$(printf '%s\n' "$b" "$a" | sort -V | head -n1)" + if test "$smallest" = "$b"; then + # $a >= $b + return 0 # true + else + return 1 # false + fi +} + +function versionXLessThanY() { + assertVersionFormat "${1}" + assertVersionFormat "${2}" + local a="${1%%-*}" + local b="${2%%-*}" + local smallest="$(printf '%s\n' "$a" "$b" | sort -V | head -n1)" + if test "$smallest" = "$a" && test "$a" != "$b"; then + # $a < $b + return 0 # true + else + return 1 # false + fi +} + # versionXLessOrEqualThanY returns true if X is less than or equal to Y; otherwise false function versionXLessOrEqualThanY() { local sourceVersion="${1}" diff --git a/spec/goss/goss.yaml b/spec/goss/goss.yaml index 25f96d9..cc3c68e 100644 --- a/spec/goss/goss.yaml +++ b/spec/goss/goss.yaml @@ -39,7 +39,7 @@ file: owner: postgres filetype: directory package: - postgresql14: + postgresql17: installed: true port: tcp:5432: