Skip to content

Instantly share code, notes, and snippets.

@cypres
Forked from petere/pg-travis-test.sh
Created June 27, 2016 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cypres/5f90b0e8cf22a4b6c92e7547ab1fea39 to your computer and use it in GitHub Desktop.
Save cypres/5f90b0e8cf22a4b6c92e7547ab1fea39 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -eux
sudo apt-get update
packages="postgresql-$PGVERSION postgresql-server-dev-$PGVERSION postgresql-common"
# bug: http://www.postgresql.org/message-id/20130508192711.GA9243@msgid.df7cb.de
sudo update-alternatives --remove-all postmaster.1.gz
# stop all existing instances (because of https://github.com/travis-ci/travis-cookbooks/pull/221)
sudo service postgresql stop
# and make sure they don't come back
echo 'exit 0' | sudo tee /etc/init.d/postgresql
sudo chmod a+x /etc/init.d/postgresql
sudo apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment