diff --git a/.github/generate-strategy.sh b/.github/generate-strategy.sh index a3223b9b..cb0debad 100755 --- a/.github/generate-strategy.sh +++ b/.github/generate-strategy.sh @@ -49,6 +49,8 @@ for version in "${ubi_versions[@]}"; do versionFile="${version}/.versions.json" fullVersion=$(jq -r '.POSTGRES_VERSION' "${versionFile}") releaseVersion=$(jq -r '.IMAGE_RELEASE_VERSION' "${versionFile}") + ubi8Version=$(jq -r '.UBI8_VERSION' "${versionFile}") + ubi9Version=$(jq -r '.UBI9_VERSION' "${versionFile}") # Initial aliases are "major version", "optional alias", "full version with release" # i.e. "13", "latest", "13.2-1" @@ -100,11 +102,13 @@ for version in "${ubi_versions[@]}"; do platformsMultiArch="${platforms}, linux/ppc64le,linux/s390x" # Build the json entry - entries+=( - "{\"name\": \"UBI ${fullVersion}\", \"platforms\": \"$platforms\", \"dir\": \"UBI/$version\", \"file\": \"UBI/$version/Dockerfile\", \"version\": \"$version\", \"tags\": [\"$(join "\", \"" "${versionAliases[@]}")\"]}" - "{\"name\": \"UBI ${fullVersion} MultiLang\", \"platforms\": \"$platforms\", \"dir\": \"UBI/$version\", \"file\": \"UBI/$version/Dockerfile.multilang\", \"version\": \"$version\", \"tags\": [\"$(join "\", \"" "${versionAliasesMultiLang[@]}")\"]}" - "{\"name\": \"UBI ${fullVersion} MultiArch\", \"platforms\": \"$platformsMultiArch\", \"dir\": \"UBI/$version\", \"file\": \"UBI/$version/Dockerfile.multiarch\", \"version\": \"$version\", \"tags\": [\"$(join "\", \"" "${versionAliasesMultiArch[@]}")\"]}" - ) + for ubiVersion in "$ubi8Version" "$ubi9Version"; do + entries+=( + "{\"name\": \"UBI${ubiVersion} ${fullVersion}\", \"ubi_version\": \"$ubiVersion\", \"platforms\": \"$platforms\", \"dir\": \"UBI/$version\", \"file\": \"UBI/$version/Dockerfile\", \"version\": \"$version\", \"tags\": [\"$(join "\", \"" "${versionAliases[@]}")\"]}" + "{\"name\": \"UBI${ubiVersion} ${fullVersion} MultiLang\", \"ubi_version\": \"$ubiVersion\", \"platforms\": \"$platforms\", \"dir\": \"UBI/$version\", \"file\": \"UBI/$version/Dockerfile.multilang\", \"version\": \"$version\", \"tags\": [\"$(join "\", \"" "${versionAliasesMultiLang[@]}")\"]}" + "{\"name\": \"UBI${ubiVersion} ${fullVersion} MultiArch\", \"ubi_version\": \"$ubiVersion\", \"platforms\": \"$platformsMultiArch\", \"dir\": \"UBI/$version\", \"file\": \"UBI/$version/Dockerfile.multiarch\", \"version\": \"$version\", \"tags\": [\"$(join "\", \"" "${versionAliasesMultiArch[@]}")\"]}" + ) + done done # UBI PostGIS diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3290589d..136f461b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,6 +114,7 @@ jobs: tags: ${{ env.TAGS }} labels: ${{ github.ref != 'refs/heads/main' && 'quay.expires-after=7d' || '' }} build-args: | + UBI_VERSION=${{ matrix.ubi_version }} SUBSCRIPTION_NAME=docker-postgresql-cicd-${{ github.run_number }} # Send a notification on release failure diff --git a/UBI/Dockerfile-multiarch.template b/UBI/Dockerfile-multiarch.template index 1a4e0fb0..df403587 100644 --- a/UBI/Dockerfile-multiarch.template +++ b/UBI/Dockerfile-multiarch.template @@ -8,7 +8,7 @@ LABEL name="PostgreSQL Container Images" \ version="%%POSTGRES_VERSION%%" \ release="%%IMAGE_RELEASE_VERSION%%" \ summary="PostgreSQL Container images." \ - description="This Docker image contains PostgreSQL and Barman Cloud based on RedHat Universal Base Images (UBI) 8." + description="This Docker image contains PostgreSQL and Barman Cloud based on RedHat Universal Base Images (UBI) %%UBI_MAJOR_VERSION%%." COPY root/ / @@ -20,10 +20,10 @@ RUN --mount=type=secret,id=cs_token \ pg_failover_slots_pkg="pg_failover_slots_%%PG_MAJOR%%" ; \ case $ARCH in \ amd64) \ - yum -y install "${base_url}/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm" ; \ + yum -y install "${base_url}/EL-%%UBI_MAJOR_VERSION%%-x86_64/pgdg-redhat-repo-latest.noarch.rpm" ; \ curl -u token:$(cat /run/secrets/cs_token) -1sLf https://downloads.enterprisedb.com/basic/enterprise/setup.rpm.sh | bash ;; \ arm64) \ - yum -y install "${base_url}/EL-8-aarch64/pgdg-redhat-repo-latest.noarch.rpm" ; \ + yum -y install "${base_url}/EL-%%UBI_MAJOR_VERSION%%-aarch64/pgdg-redhat-repo-latest.noarch.rpm" ; \ curl -u token:$(cat /run/secrets/cs_token) -1sLf https://downloads.enterprisedb.com/basic/enterprise/setup.rpm.sh | bash ;; \ ppc64le) \ curl -u token:$(cat /run/secrets/cs_token) -1sLf https://downloads.enterprisedb.com/basic/enterprise/setup.rpm.sh | bash ; \ diff --git a/UBI/Dockerfile-multilang.template b/UBI/Dockerfile-multilang.template index 5fa01885..92b9a985 100644 --- a/UBI/Dockerfile-multilang.template +++ b/UBI/Dockerfile-multilang.template @@ -8,7 +8,7 @@ LABEL name="PostgreSQL Container Images" \ version="%%POSTGRES_VERSION%%" \ release="%%IMAGE_RELEASE_VERSION%%" \ summary="PostgreSQL Container images." \ - description="This Docker image contains PostgreSQL and Barman Cloud based on RedHat Universal Base Images (UBI) 8." + description="This Docker image contains PostgreSQL and Barman Cloud based on RedHat Universal Base Images (UBI) %%UBI_MAJOR_VERSION%%." COPY root/ / @@ -20,10 +20,10 @@ RUN --mount=type=secret,id=cs_token \ pg_failover_slots_pkg="pg_failover_slots_%%PG_MAJOR%%" ; \ case $ARCH in \ amd64) \ - yum -y install "${base_url}/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm" ; \ + yum -y install "${base_url}/EL-%%UBI_MAJOR_VERSION%%-x86_64/pgdg-redhat-repo-latest.noarch.rpm" ; \ curl -u token:$(cat /run/secrets/cs_token) -1sLf https://downloads.enterprisedb.com/basic/enterprise/setup.rpm.sh | bash ;; \ arm64) \ - yum -y install "${base_url}/EL-8-aarch64/pgdg-redhat-repo-latest.noarch.rpm" ; \ + yum -y install "${base_url}/EL-%%UBI_MAJOR_VERSION%%-aarch64/pgdg-redhat-repo-latest.noarch.rpm" ; \ curl -u token:$(cat /run/secrets/cs_token) -1sLf https://downloads.enterprisedb.com/basic/enterprise/setup.rpm.sh | bash ;; \ ppc64le) \ curl -u token:$(cat /run/secrets/cs_token) -1sLf https://downloads.enterprisedb.com/basic/enterprise/setup.rpm.sh | bash ; \ diff --git a/UBI/Dockerfile-postgis-multilang.template b/UBI/Dockerfile-postgis-multilang.template index 0023e791..367b3937 100644 --- a/UBI/Dockerfile-postgis-multilang.template +++ b/UBI/Dockerfile-postgis-multilang.template @@ -9,7 +9,7 @@ LABEL name="PostgreSQL + PostGIS Container Images" \ version="%%POSTGRES_VERSION%%" \ release="%%IMAGE_RELEASE_VERSION%%" \ summary="PostgreSQL + PostGIS Container images." \ - description="This Docker image contains PostgreSQL, PostGIS and Barman Cloud based on RedHat Universal Base Images (UBI) 8." + description="This Docker image contains PostgreSQL, PostGIS and Barman Cloud based on RedHat Universal Base Images (UBI) %%UBI_MAJOR_VERSION%%." COPY root/ / @@ -19,9 +19,9 @@ RUN set -xe ; \ base_url="https://download.postgresql.org/pub/repos/yum/reporpms" ; \ case $ARCH in \ amd64) \ - yum -y install "${base_url}/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm" ;; \ + yum -y install "${base_url}/EL-%%UBI_MAJOR_VERSION%%-x86_64/pgdg-redhat-repo-latest.noarch.rpm" ;; \ arm64) \ - yum -y install "${base_url}/EL-8-aarch64/pgdg-redhat-repo-latest.noarch.rpm" ;; \ + yum -y install "${base_url}/EL-%%UBI_MAJOR_VERSION%%-aarch64/pgdg-redhat-repo-latest.noarch.rpm" ;; \ *) \ exit 1 ;; \ esac ; \ diff --git a/UBI/Dockerfile-postgis.template b/UBI/Dockerfile-postgis.template index 7d569424..13c3f1b7 100644 --- a/UBI/Dockerfile-postgis.template +++ b/UBI/Dockerfile-postgis.template @@ -9,7 +9,7 @@ LABEL name="PostgreSQL + PostGIS Container Images" \ version="%%POSTGRES_VERSION%%" \ release="%%IMAGE_RELEASE_VERSION%%" \ summary="PostgreSQL + PostGIS Container images." \ - description="This Docker image contains PostgreSQL, PostGIS and Barman Cloud based on RedHat Universal Base Images (UBI) 8." + description="This Docker image contains PostgreSQL, PostGIS and Barman Cloud based on RedHat Universal Base Images (UBI) %%UBI_MAJOR_VERSION%%." COPY root/ / @@ -19,9 +19,9 @@ RUN set -xe ; \ base_url="https://download.postgresql.org/pub/repos/yum/reporpms" ; \ case $ARCH in \ amd64) \ - yum -y install "${base_url}/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm" ;; \ + yum -y install "${base_url}/EL-%%UBI_MAJOR_VERSION%%-x86_64/pgdg-redhat-repo-latest.noarch.rpm" ;; \ arm64) \ - yum -y install "${base_url}/EL-8-aarch64/pgdg-redhat-repo-latest.noarch.rpm" ;; \ + yum -y install "${base_url}/EL-%%UBI_MAJOR_VERSION%%-aarch64/pgdg-redhat-repo-latest.noarch.rpm" ;; \ *) \ exit 1 ;; \ esac ; \ diff --git a/UBI/Dockerfile.template b/UBI/Dockerfile.template index 3c671b1d..6338070e 100644 --- a/UBI/Dockerfile.template +++ b/UBI/Dockerfile.template @@ -8,7 +8,7 @@ LABEL name="PostgreSQL Container Images" \ version="%%POSTGRES_VERSION%%" \ release="%%IMAGE_RELEASE_VERSION%%" \ summary="PostgreSQL Container images." \ - description="This Docker image contains PostgreSQL and Barman Cloud based on RedHat Universal Base Images (UBI) 8." + description="This Docker image contains PostgreSQL and Barman Cloud based on RedHat Universal Base Images (UBI) %%UBI_MAJOR_VERSION%%." COPY root/ / @@ -20,10 +20,10 @@ RUN --mount=type=secret,id=cs_token \ pg_failover_slots_pkg="pg_failover_slots_%%PG_MAJOR%%" ; \ case $ARCH in \ amd64) \ - yum -y install "${base_url}/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm" ; \ + yum -y install "${base_url}/EL-%%UBI_MAJOR_VERSION%%-x86_64/pgdg-redhat-repo-latest.noarch.rpm" ; \ curl -u token:$(cat /run/secrets/cs_token) -1sLf https://downloads.enterprisedb.com/basic/enterprise/setup.rpm.sh | bash ;; \ arm64) \ - yum -y install "${base_url}/EL-8-aarch64/pgdg-redhat-repo-latest.noarch.rpm" ; \ + yum -y install "${base_url}/EL-%%UBI_MAJOR_VERSION%%-aarch64/pgdg-redhat-repo-latest.noarch.rpm" ; \ curl -u token:$(cat /run/secrets/cs_token) -1sLf https://downloads.enterprisedb.com/basic/enterprise/setup.rpm.sh | bash ;; \ ppc64le) \ curl -u token:$(cat /run/secrets/cs_token) -1sLf https://downloads.enterprisedb.com/basic/enterprise/setup.rpm.sh | bash ; \ diff --git a/UBI/update.sh b/UBI/update.sh index 8a40550e..6458c660 100755 --- a/UBI/update.sh +++ b/UBI/update.sh @@ -7,7 +7,7 @@ # `ReleaseVersion` of the image will be increased by one. # -set -Eeuo pipefail +# set -Eeuo pipefail cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" @@ -42,8 +42,10 @@ get_latest_ubi_tag() { # Get the latest UBI base image get_latest_ubi_base() { + local ubi_version=$1 rawContent=$(curl -s -L https://quay.io/api/v1/repository/enterprisedb/edb-ubi/tag/?onlyActiveTags=true) echo $rawContent | jq -r '.tags | sort_by(.start_ts) | .[] | select(.is_manifest_list == true) | .name' | tail -n1 + echo $rawContent | jq -r --arg ubi_version "$ubi_version" '.tags | sort_by(.start_ts) | .[] | select(.is_manifest_list == true and .name | startswith($ubi_version)) | .name' | tail -n1 } declare -A pgArchMatrix=( @@ -113,6 +115,7 @@ compare_architecture_pkgs() { # Get the latest Barman version latest_barman_version= _raw_get_latest_barman_version() { + echo "Getting latest barman version" curl -s https://pypi.org/pypi/barman/json | jq -r '.releases | keys[]' | sort -Vr | head -n1 } get_latest_barman_version() { @@ -177,30 +180,45 @@ record_version() { generate_redhat() { local version="$1"; shift - ubiRelease="8" + ubi8Release="8" + ubi9Release="9" local versionFile="${version}/.versions.json" imageReleaseVersion=1 # cache the result - get_latest_ubi_base >/dev/null + get_latest_ubi_base $ubi8Release >/dev/null + get_latest_ubi_base $ubi9Release >/dev/null get_latest_barman_version >/dev/null - ubiVersion=$(get_latest_ubi_base) - if [ -z "$ubiVersion" ]; then - echo "Unable to retrieve latest UBI${ubiRelease} version" + ubi8Version=$(get_latest_ubi_base $ubi8Release) + ubi9Version=$(get_latest_ubi_base $ubi9Release) + if [ -z "$ubi8Version" ]; then + echo "Unable to retrieve latest UBI${ubi8Release} version" + exit 1 + fi + if [ -z "$ubi9Version" ]; then + echo "Unable to retrieve latest UBI${ubi9Release} version" exit 1 fi - pg_x86_64=$(get_postgresql_version "${ubiRelease}" 'x86_64' "$version") - pg_ppc64le=$(get_postgresql_version "${ubiRelease}" 'ppc64le' "$version") - pg_s390x=$(get_postgresql_version "${ubiRelease}" 's390x' "$version") - pg_arm64=$(get_postgresql_version "${ubiRelease}" 'aarch64' "$version") - if ! compare_architecture_pkgs "$pg_x86_64" "$pg_arm64" "$pg_ppc64le" "$pg_s390x"; then + ubi8_pg_x86_64=$(get_postgresql_version "${ubi8Release}" 'x86_64' "$version") + ubi8_pg_ppc64le=$(get_postgresql_version "${ubi8Release}" 'ppc64le' "$version") + ubi8_pg_s390x=$(get_postgresql_version "${ubi8Release}" 's390x' "$version") + ubi8_pg_arm64=$(get_postgresql_version "${ubi8Release}" 'aarch64' "$version") + if ! compare_architecture_pkgs "$ubi8_pg_x86_64" "$ubi8_pg_arm64" "$ubi8_pg_ppc64le" "$ubi8_pg_s390x"; then return fi - postgresqlVersion="${pg_x86_64}" + ubi9_pg_x86_64=$(get_postgresql_version "${ubi9Release}" 'x86_64' "$version") + ubi9_pg_ppc64le=$(get_postgresql_version "${ubi9Release}" 'ppc64le' "$version") + ubi9_pg_s390x=$(get_postgresql_version "${ubi9Release}" 's390x' "$version") + ubi9_pg_arm64=$(get_postgresql_version "${ubi9Release}" 'aarch64' "$version") + if ! compare_architecture_pkgs "$ubi9_pg_x86_64" "$ubi9_pg_arm64" "$ubi9_pg_ppc64le" "$ubi9_pg_s390x"; then + return + fi + + postgresqlVersion="${ubi8_pg_x86_64}" if [ -z "$postgresqlVersion" ]; then echo "Unable to retrieve latest PostgreSQL $version version" return @@ -228,16 +246,20 @@ generate_redhat() { echo "$version: ${postgresqlVersion}" if [ -f "${versionFile}" ]; then - oldUbiVersion=$(jq -r '.UBI_VERSION' "${versionFile}") + echo "versionFile exists" + oldUbi8Version=$(jq -r '.UBI8_VERSION' "${versionFile}") + oldUbi9Version=$(jq -r '.UBI9_VERSION' "${versionFile}") oldPostgresqlVersion=$(jq -r '.POSTGRES_VERSION' "${versionFile}") oldBarmanVersion=$(jq -r '.BARMAN_VERSION' "${versionFile}") oldImageReleaseVersion=$(jq -r '.IMAGE_RELEASE_VERSION' "${versionFile}") imageReleaseVersion=$oldImageReleaseVersion else + echo "versionFile does not exist" imageReleaseVersion=1 echo "{}" > "${versionFile}" - record_version "${versionFile}" "UBI_VERSION" "${ubiVersion}" + record_version "${versionFile}" "UBI8_VERSION" "${ubi8Version}" + record_version "${versionFile}" "UBI9_VERSION" "${ubi9Version}" record_version "${versionFile}" "POSTGRES_VERSION" "${postgresqlVersion}" record_version "${versionFile}" "BARMAN_VERSION" "${barmanVersion}" record_version "${versionFile}" "IMAGE_RELEASE_VERSION" "${imageReleaseVersion}" @@ -248,10 +270,16 @@ generate_redhat() { newRelease="false" # Detect an update of UBI image - if [ "$oldUbiVersion" != "$ubiVersion" ]; then - echo "UBI changed from $oldUbiVersion to $ubiVersion" + if [ "$oldUbi8Version" != "$ubi8Version" ]; then + echo "UBI changed from $oldUbi8Version to $ubi8Version" newRelease="true" - record_version "${versionFile}" "UBI_VERSION" "${ubiVersion}" + record_version "${versionFile}" "UBI_VERSION" "${ubi8Version}" + fi + + if [ "$oldUbi9Version" != "$ubi9Version" ]; then + echo "UBI changed from $oldUbi9Version to $ubi9Version" + newRelease="true" + record_version "${versionFile}" "UBI_VERSION" "${ubi9Version}" fi # Detect an update of Barman @@ -273,32 +301,65 @@ generate_redhat() { fi rm -fr "${version:?}"/* - sed -e 's/%%UBI_VERSION%%/'"$ubiVersion"'/g' \ + sed -e 's/%%UBI_VERSION%%/'"$ubi8Version"'/g' \ + -e 's/%%UBI_MAJOR_VERSION%%/'"$ubi8Release"'/g' \ -e 's/%%PG_MAJOR%%/'"$version"'/g' \ -e 's/%%YUM_OPTIONS%%/'"${yumOptions}"'/g' \ -e 's/%%POSTGRES_VERSION%%/'"$postgresqlVersion"'/g' \ -e 's/%%PGAUDIT_VERSION%%/'"$pgauditVersion"'/g' \ -e 's/%%IMAGE_RELEASE_VERSION%%/'"$imageReleaseVersion"'/g' \ Dockerfile.template \ - >"$version/Dockerfile" + >"$version/Dockerfile.ubi8" - sed -e 's/%%UBI_VERSION%%/'"$ubiVersion"'/g' \ + sed -e 's/%%UBI_VERSION%%/'"$ubi8Version"'/g' \ + -e 's/%%UBI_MAJOR_VERSION%%/'"$ubi8Release"'/g' \ -e 's/%%PG_MAJOR%%/'"$version"'/g' \ -e 's/%%YUM_OPTIONS%%/'"${yumOptions}"'/g' \ -e 's/%%POSTGRES_VERSION%%/'"$postgresqlVersion"'/g' \ -e 's/%%PGAUDIT_VERSION%%/'"$pgauditVersion"'/g' \ -e 's/%%IMAGE_RELEASE_VERSION%%/'"$imageReleaseVersion"'/g' \ Dockerfile-multilang.template \ - >"$version/Dockerfile.multilang" + >"$version/Dockerfile.multilang.ubi8" - sed -e 's/%%UBI_VERSION%%/'"$ubiVersion"'/g' \ + sed -e 's/%%UBI_VERSION%%/'"$ubi8Version"'/g' \ + -e 's/%%UBI_MAJOR_VERSION%%/'"$ubi8Release"'/g' \ -e 's/%%PG_MAJOR%%/'"$version"'/g' \ -e 's/%%YUM_OPTIONS%%/'"${yumOptions}"'/g' \ -e 's/%%POSTGRES_VERSION%%/'"$postgresqlVersion"'/g' \ -e 's/%%PGAUDIT_VERSION%%/'"$pgauditVersion"'/g' \ -e 's/%%IMAGE_RELEASE_VERSION%%/'"$imageReleaseVersion"'/g' \ Dockerfile-multiarch.template \ - >"$version/Dockerfile.multiarch" + >"$version/Dockerfile.multiarch.ubi8" + + sed -e 's/%%UBI_VERSION%%/'"$ubi9Version"'/g' \ + -e 's/%%UBI_MAJOR_VERSION%%/'"$ubi9Release"'/g' \ + -e 's/%%PG_MAJOR%%/'"$version"'/g' \ + -e 's/%%YUM_OPTIONS%%/'"${yumOptions}"'/g' \ + -e 's/%%POSTGRES_VERSION%%/'"$postgresqlVersion"'/g' \ + -e 's/%%PGAUDIT_VERSION%%/'"$pgauditVersion"'/g' \ + -e 's/%%IMAGE_RELEASE_VERSION%%/'"$imageReleaseVersion"'/g' \ + Dockerfile.template \ + >"$version/Dockerfile.ubi9" + + sed -e 's/%%UBI_VERSION%%/'"$ubi9Version"'/g' \ + -e 's/%%UBI_MAJOR_VERSION%%/'"$ubi9Release"'/g' \ + -e 's/%%PG_MAJOR%%/'"$version"'/g' \ + -e 's/%%YUM_OPTIONS%%/'"${yumOptions}"'/g' \ + -e 's/%%POSTGRES_VERSION%%/'"$postgresqlVersion"'/g' \ + -e 's/%%PGAUDIT_VERSION%%/'"$pgauditVersion"'/g' \ + -e 's/%%IMAGE_RELEASE_VERSION%%/'"$imageReleaseVersion"'/g' \ + Dockerfile-multilang.template \ + >"$version/Dockerfile.multilang.ubi9" + + sed -e 's/%%UBI_VERSION%%/'"$ubi9Version"'/g' \ + -e 's/%%UBI_MAJOR_VERSION%%/'"$ubi9Release"'/g' \ + -e 's/%%PG_MAJOR%%/'"$version"'/g' \ + -e 's/%%YUM_OPTIONS%%/'"${yumOptions}"'/g' \ + -e 's/%%POSTGRES_VERSION%%/'"$postgresqlVersion"'/g' \ + -e 's/%%PGAUDIT_VERSION%%/'"$pgauditVersion"'/g' \ + -e 's/%%IMAGE_RELEASE_VERSION%%/'"$imageReleaseVersion"'/g' \ + Dockerfile-multiarch.template \ + >"$version/Dockerfile.multiarch.ubi9" cp -r src/* "$version/" } @@ -311,10 +372,10 @@ generate_redhat_postgis() { imageReleaseVersion=1 # cache the result - get_latest_ubi_base >/dev/null + get_latest_ubi_base 8 >/dev/null get_latest_barman_version >/dev/null - ubiVersion=$(get_latest_ubi_base) + ubiVersion=$(get_latest_ubi_base 8) if [ -z "$ubiVersion" ]; then echo "Unable to retrieve latest UBI${ubiRelease} version" exit 1 @@ -369,7 +430,7 @@ generate_redhat_postgis() { echo "$version: ${postgresqlVersion} - PostGIS ${postgisVersion}" if [ -f "${versionFile}" ]; then - oldUbiVersion=$(jq -r '.UBI_VERSION' "${versionFile}") + oldUbiVersion=$(jq -r '.UBI8_VERSION' "${versionFile}") oldPostgresqlVersion=$(jq -r '.POSTGRES_VERSION' "${versionFile}") oldPostgisVersion=$(jq -r '.POSTGIS_VERSION' "${versionFile}") oldBarmanVersion=$(jq -r '.BARMAN_VERSION' "${versionFile}") @@ -379,7 +440,7 @@ generate_redhat_postgis() { imageReleaseVersion=1 echo "{}" > "${versionFile}" - record_version "${versionFile}" "UBI_VERSION" "${ubiVersion}" + record_version "${versionFile}" "UBI8_VERSION" "${ubiVersion}" record_version "${versionFile}" "POSTGRES_VERSION" "${postgresqlVersion}" record_version "${versionFile}" "POSTGIS_VERSION" "${postgisVersion}" record_version "${versionFile}" "BARMAN_VERSION" "${barmanVersion}" @@ -471,6 +532,7 @@ update_requirements() { update_requirements for version in "${versions[@]}"; do + echo "Generating Dockerfiles for $version" generate_redhat "${version}" generate_redhat_postgis "${version}" done