Skip to content

Instantly share code, notes, and snippets.

@schinckel
Forked from bradrydzewski/install.sh
Last active August 9, 2017 18:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save schinckel/cc3f4d6067458f935ae3 to your computer and use it in GitHub Desktop.
Save schinckel/cc3f4d6067458f935ae3 to your computer and use it in GitHub Desktop.
Drone.io Install Postgres9.4
#!/bin/bash
# remove existing 9.3 installation
sudo /etc/init.d/postgresql stop
sudo apt-get --force-yes -fuy remove --purge postgresql postgresql-9.1 postgresql-client
# install 9.4
sudo apt-get install python-software-properties
sudo add-apt-repository 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main 9.4'
sudo apt-get update
sudo apt-get install -y postgresql-client-9.4 postgresql-9.4
# update the postgres config files
sudo /bin/bash -c "cat <<EOF > /etc/postgresql/9.4/main/pg_hba.conf
local all postgres trust
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
EOF"
initdb
# restart
sudo /etc/init.d/postgresql restart
@schinckel
Copy link
Author

Usage (in your drone.io Settings/Build & Test/Commands:

curl --silent https://gist.githubusercontent.com/schinckel/cc3f4d6067458f935ae3/raw/70c6e69f52dedc838167673221b30003e8dee61c/install.sh | /bin/bash -s 1> /dev/null 2> /dev/null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment