Skip to content

Instantly share code, notes, and snippets.

@jnwheeler44
Created December 29, 2016 19:34
Show Gist options
  • Save jnwheeler44/220a77ce680431a625878e9da0de1b0e to your computer and use it in GitHub Desktop.
Save jnwheeler44/220a77ce680431a625878e9da0de1b0e to your computer and use it in GitHub Desktop.
How to use Postgres 9.6.1 on circleci 14.04 image
# Other settings have been omitted, the below changes are relevant
machine:
pre:
- sudo service postgresql stop
- sudo apt-get purge -y postgresql*
- sudo apt-get update
- sudo apt-get install postgresql
- sudo service postgresql start
- sudo su - postgres -c "echo \"create user ubuntu with password 'ubuntu';\" | psql"
- sudo su - postgres -c "echo \"alter user ubuntu with superuser;\" | psql"
- sudo su - postgres -c "echo \"create database ubuntu;\" | psql"
database:
override:
- mv config/database.ci.yml config/database.yml
- bundle exec rake db:create db:structure:load --trace
# config/database.ci.yml
test:
adapter: postgresql
database: circle_ruby_test
username: ubuntu
password: ubuntu
encoding: unicode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment