Install postgres from pgdg on travis if available there

This commit is contained in:
Daniele Varrazzo 2019-10-19 14:22:19 +02:00
parent f08019e356
commit 58654990d6

View File

@ -39,9 +39,21 @@ create () {
# install postgres versions not available on the image # install postgres versions not available on the image
if [[ ! -d "${PGDIR}" ]]; then if [[ ! -d "${PGDIR}" ]]; then
wget -O - http://initd.org/psycopg/upload/postgresql/postgresql-${PACKAGE}-$(lsb_release -cs).tar.bz2 \ if (( "$VERNUM" >= 904 )); then
# A versiou supported by postgres
if [[ ! "${apt_updated:-}" ]]; then
apt_updated="yeah"
sudo apt-get update -y
fi
sudo apt-get install -y \
postgresql-server-dev-${VERSION} postgresql-${VERSION}
else
# A dinosaur
wget -O - \
http://initd.org/psycopg/upload/postgresql/postgresql-${PACKAGE}-$(lsb_release -cs).tar.bz2 \
| sudo tar xjf - -C /usr/lib/postgresql | sudo tar xjf - -C /usr/lib/postgresql
fi fi
fi
sudo -u postgres "$PGBIN/initdb" -D "$DATADIR" sudo -u postgres "$PGBIN/initdb" -D "$DATADIR"