Skip to content

Instantly share code, notes, and snippets.

@mceachen
Created April 9, 2012 01:28
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mceachen/2340726 to your computer and use it in GitHub Desktop.
Save mceachen/2340726 to your computer and use it in GitHub Desktop.
Travis CI with multiple database engines
language: ruby
rvm:
- 1.9.3
env:
- DB=sqlite
- DB=mysql
- DB=postgresql
script:
- RAILS_ENV=test bundle exec rake --trace db:migrate test
before_script:
- mysql -e 'create database chromotype_test'
- psql -c 'create database chromotype_test' -U postgres
sqlite: &sqlite
adapter: sqlite3
database: db/<%= Rails.env %>.sqlite3
mysql: &mysql
adapter: mysql2
username: root
password:
database: <%= Rails.root.basename.to_s %>_<%= Rails.env %>
postgresql: &postgresql
adapter: postgresql
username: postgres
password:
database: <%= Rails.root.basename.to_s %>_<%= Rails.env %>
min_messages: ERROR
defaults: &defaults
pool: 5
timeout: 5000
host: localhost
<<: *<%= ENV['DB'] || "postgresql" %>
development:
<<: *defaults
test:
<<: *defaults
production:
<<: *defaults
# Change this to erb-echo the production password from /etc/something here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment