Skip to content

Commit

Permalink
feat: Move PostGIS extension from Debian to UBI (#80)
Browse files Browse the repository at this point in the history
Now the PostGIS extension will be available only on UBI and not on Debian anymore.
Everything related to PostGIS on Debian will be deleted after this patch, including
docker images in the Quay.io registry where they were published.

Co-authored-by: John Long <john.long@enterprisedb.com>
Co-authored-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
  • Loading branch information
3 people authored Feb 28, 2022
1 parent 0ae4621 commit adbe335
Show file tree
Hide file tree
Showing 32 changed files with 983 additions and 1,280 deletions.
98 changes: 49 additions & 49 deletions .github/generate-strategy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

set -eu
declare BUILD_IRONBANK=false
# Want to get the IronBank during the Continuous Integration step
# Want to get the IronBank during the Continuous Integration step
# but not during the Continuous Delivery step.
while getopts "i" option; do
case $option in
i)
BUILD_IRONBANK=true
;;
;;
esac
done

Expand Down Expand Up @@ -117,6 +117,46 @@ for version in "${ubi_versions[@]}"; do
)
done

for version in "${ubi_versions[@]}"; do

# Read versions from the definition file
versionFile="${version}/.versions.json"
fullVersion=$(jq -r '.POSTGRES_VERSION | split("-") | .[0]' "${versionFile}")
releaseVersion=$(jq -r '.IMAGE_RELEASE_VERSION' "${versionFile}")

# Initial aliases are "major version", "optional alias", "full version with release"
# i.e. "13", "latest", "13.2-1"
# A "-beta" suffix will be appended to the beta images.
if [ "${version}" -gt '14' ]; then
fullVersion="${fullVersion//'~'/-}"
versionAliases=(
"${version}-beta-postgis"
${aliases[$version]:+"${aliases[$version]}-postgis"}
"${fullVersion}-postgis-${releaseVersion}"
)
else
versionAliases=(
"${version}-postgis"
${aliases[$version]:+"${aliases[$version]}-postgis"}
"${fullVersion}-postgis-${releaseVersion}"
)
fi

# Add all the version prefixes between full version and major version
# i.e "13.2"
while [ "$fullVersion" != "$version" ] && [ "${fullVersion%[.-]*}" != "$fullVersion" ]; do
versionAliases+=("$fullVersion-postgis")
fullVersion="${fullVersion%[.-]*}"
done

platforms="linux/amd64"

# Build the json entry
entries+=(
"{\"name\": \"UBI PostGIS ${fullVersion}\", \"platforms\": \"$platforms\", \"dir\": \"UBI/$version\", \"file\": \"UBI/$version/Dockerfile.postgis\",\"version\": \"$version\", \"tags\": [\"$(join "\", \"" "${versionAliases[@]}")\"]}"
)
done

cd "$BASE_DIRECTORY"/IronBank/
for version in "${ironbank_versions[@]}"; do

Expand Down Expand Up @@ -149,23 +189,23 @@ for version in "${ironbank_versions[@]}"; do
fullVersion="${fullVersion%[.-]*}"
done

# Only
# Only
platforms="linux/amd64"
IB_BASE_REGISTRY="registry.access.redhat.com"
IB_BASE_IMAGE="ubi8"

# Build the json entry
if [[ "$BUILD_IRONBANK" == "true" ]]; then
entries+=(
"{ \"name\": \"IronBank ${fullVersion}\",
\"platforms\": \"$platforms\",
\"dir\": \"IronBank/$version\",
\"file\": \"IronBank/$version/Dockerfile\",
\"version\": \"$version\",
"{ \"name\": \"IronBank ${fullVersion}\",
\"platforms\": \"$platforms\",
\"dir\": \"IronBank/$version\",
\"file\": \"IronBank/$version/Dockerfile\",
\"version\": \"$version\",
\"tags\": [\"$(join "\", \"" "${versionAliases[@]}")\"],
\"build_args\": {\"BASE_REGISTRY\": \"${IB_BASE_REGISTRY}\", \"BASE_IMAGE\": \"${IB_BASE_IMAGE}\"}
}" )
fi
fi
done

cd "$BASE_DIRECTORY"/Debian/
Expand Down Expand Up @@ -210,46 +250,6 @@ for version in "${debian_versions[@]}"; do
)
done

for version in "${debian_versions[@]}"; do

# Read versions from the definition file
versionFile="${version}/.versions.json"
fullVersion=$(jq -r '.POSTGRES_VERSION | split("-") | .[0]' "${versionFile}")
releaseVersion=$(jq -r '.IMAGE_RELEASE_VERSION' "${versionFile}")

# Initial aliases are "major version", "optional alias", "full version with release"
# i.e. "13", "latest", "13.2-1"
# A "-beta" suffix will be appended to the beta images.
if [ "${version}" -gt '14' ]; then
fullVersion="${fullVersion//'~'/-}"
versionAliases=(
"${version}-beta-debian-postgis"
${aliases[$version]:+"${aliases[$version]}-debian-postgis"}
"${fullVersion}-debian-postgis-${releaseVersion}"
)
else
versionAliases=(
"${version}-debian-postgis"
${aliases[$version]:+"${aliases[$version]}-debian-postgis"}
"${fullVersion}-debian-postgis-${releaseVersion}"
)
fi

# Add all the version prefixes between full version and major version
# i.e "13.2"
while [ "$fullVersion" != "$version" ] && [ "${fullVersion%[.-]*}" != "$fullVersion" ]; do
versionAliases+=("$fullVersion-debian-postgis")
fullVersion="${fullVersion%[.-]*}"
done

platforms="linux/amd64"

# Build the json entry
entries+=(
"{\"name\": \"Debian PostGIS ${fullVersion}\", \"platforms\": \"$platforms\", \"dir\": \"Debian/$version\", \"file\": \"Debian/$version/Dockerfile.postgis\",\"version\": \"$version\", \"tags\": [\"$(join "\", \"" "${versionAliases[@]}")\"]}"
)
done

# Build the strategy as a JSON object
strategy="{\"fail-fast\": false, \"matrix\": {\"include\": [$(join ', ' "${entries[@]}")]}}"
jq -C . <<<"$strategy" # sanity check / debugging aid
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
file: ${{ matrix.file }}
secrets: |
"cs_script=${{ secrets.CS_SCRIPT }}"
"subscription=${{ secrets.SUBSCRIPTION }}"
push: false
load: true
tags: ${{ steps.docker-meta.outputs.tags }}
Expand All @@ -101,6 +102,7 @@ jobs:
file: ${{ matrix.file }}
secrets: |
"cs_script=${{ secrets.CS_SCRIPT }}"
"subscription=${{ secrets.SUBSCRIPTION }}"
# Available architecture on UBI8 are: linux/amd64, linux/s390x, linux/ppc64le
platforms: ${{ matrix.platforms }}
push: true
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
file: ${{ matrix.file }}
secrets: |
"cs_script=${{ secrets.CS_SCRIPT }}"
"subscription=${{ secrets.SUBSCRIPTION }}"
push: false
tags: ${{ steps.docker-meta.outputs.tags }}
load: true
Expand Down
203 changes: 0 additions & 203 deletions Debian/10/Dockerfile.postgis

This file was deleted.

Loading

0 comments on commit adbe335

Please sign in to comment.