Skip to content

Instantly share code, notes, and snippets.

@cmhobbs
Forked from bigfive/database.yml
Last active August 29, 2015 14:17
Show Gist options
  • Save cmhobbs/a25b31b18dade3d54443 to your computer and use it in GitHub Desktop.
Save cmhobbs/a25b31b18dade3d54443 to your computer and use it in GitHub Desktop.
core: &core
adapter: postgis
encoding: unicode
host: 127.0.0.1
username: postgres
database: magnum<%= ENV['CI_BUILD_NUMBER'] %>
development:
<<: *core
test:
<<: *core
staging:
<<: *core
production:
<<: *core
@cmhobbs
Copy link
Author

cmhobbs commented Mar 20, 2015

install our own postgres and postgis

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update -y
sudo apt-get install postgresql-9.3-postgis-2.1 postgresql-9.3 postgresql-server-dev-9.3 -y
sudo ldconfig
sudo service postgresql start

create and extend the db

psql -c "create database magnum$CI_BUILD_NUMBER;" -U postgres
psql -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;" magnum$CI_BUILD_NUMBER

grab this database.yml

curl -o config/database.yml 'https://gist.githubusercontent.com/cmhobbs/a25b31b18dade3d54443/raw/fd0411c8dbd36e7e434af974b29ec3e1a5a5ac58/database.yml'

@cmhobbs
Copy link
Author

cmhobbs commented Mar 20, 2015

Note that magnum-ci will always try to run bundle exec rake db:create and it will always fail. I'm trying to find ways to get rid of that step in their configuration.

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