gitlab-build-images/scripts/install-postgresql
Balasankar "Balu" C 687520e804
Use stretch repos of PostgreSQL
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2019-04-02 17:21:02 +05:30

16 lines
449 B
Bash
Executable file

#!/bin/bash
set -xeuo pipefail
IFS=$'\n\t'
POSTGRES_VERSION=${1:-9.6}
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/*