Skip to content

Instantly share code, notes, and snippets.

@NikolayS
Forked from jnwheeler44/circle.yml
Created January 27, 2017 17:18
Show Gist options
  • Save NikolayS/cbae06f86bc06db43adab0072b6b17ac to your computer and use it in GitHub Desktop.
Save NikolayS/cbae06f86bc06db43adab0072b6b17ac 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