* Add Amazon Linux 2 as a supported OS. * Dynamically select the package manager for Amazon and Oracle Linux. * Prepare for supporting PostgreSQL 18. Specifically, the Docker image seems to have moved the data directory, so get that dynamically.
67 lines
1.3 KiB
Bash
Executable File
67 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Versions to test
|
|
versions=( $@ )
|
|
|
|
# If we weren't given any versions, test them all
|
|
if [ ${#versions[@]} -eq 0 ]
|
|
then
|
|
versions=( 9.2 9.4 9.6 10 11 12 13 14 15 16 17 )
|
|
fi
|
|
|
|
# Image tags to use
|
|
declare -A images=()
|
|
images["9.2"]='9.2'
|
|
images["9.3"]='9.3'
|
|
images["9.4"]='9.4'
|
|
images["9.5"]='9.5'
|
|
images["9.6"]='9.6-bullseye'
|
|
images["10"]='10-bullseye'
|
|
images["11"]='11-bookworm'
|
|
images["12"]='12-bookworm'
|
|
images["13"]='13-bookworm'
|
|
images["14"]='14-bookworm'
|
|
images["15"]='15-bookworm'
|
|
images["16"]='16-bookworm'
|
|
images["17"]='17-bookworm'
|
|
images["18"]='18-trixie'
|
|
|
|
declare -A results=()
|
|
|
|
# Make sure everything's down to start with
|
|
docker compose down
|
|
|
|
# Make sure our agent container is up to date
|
|
docker compose build agent
|
|
|
|
for version in "${versions[@]}"
|
|
do
|
|
echo
|
|
echo "Testing: PostgreSQL ${version}"
|
|
|
|
# Specify the version we're testing against
|
|
export PGTAG="${images["$version"]}"
|
|
|
|
# Start the containers
|
|
docker compose up --exit-code-from=agent agent
|
|
rc=$?
|
|
|
|
results["$version"]=$rc
|
|
|
|
# Destroy the containers
|
|
docker compose down
|
|
done
|
|
|
|
echo
|
|
echo
|
|
for v in "${versions[@]}"
|
|
do
|
|
case "${results["$v"]}" in
|
|
0) msg="OK" ;;
|
|
1) msg="Query failure detected" ;;
|
|
18) msg="Docker image error: 18" ;;
|
|
*) msg="Unexpected error: ${results["$v"]}" ;;
|
|
esac
|
|
echo "$v -> $msg"
|
|
done
|