gitlab-build-images/scripts/install-postgresql
Stan Hu a82fd6a09b
Make PostgreSQL v12 the default
This commit is just needed to trigger a new build with PostgreSQL
v12.9.
2021-11-11 07:50:17 -08:00

16 lines
448 B
Bash
Executable file

#!/bin/bash
set -xeuo pipefail
IFS=$'\n\t'
POSTGRES_VERSION=${1:-12}
export DEBIAN_FRONTEND=noninteractive
curl -sS -L https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" | tee /etc/apt/sources.list.d/postgresql.list
apt-get update
apt-get install -y postgresql-client-${POSTGRES_VERSION}
apt-get autoremove -yq
apt-get clean -yqq
rm -rf /var/lib/apt/lists/*