env:
  - DB=pg
  - DB=mysql
language: ruby
rvm:
  - 2.1.5
bundler_args: --without development production
cache: bundler
sudo: false
services:
  - mysql
  - postgresql
script:
  - RAILS_ENV=test bundle exec rake --trace db:migrate
  - bundle exec rspec
before_script:
  - "echo -e 'test:\\n  adapter: mysql2\\n  database: onebody_test\\n  username: travis\\n  encoding: utf8' > config/database.yml.mysql"
  - "echo -e 'test:\\n  adapter: postgresql\\n  database: onebody_test\\n  username: postgres\\n  encoding: unicode' > config/database.yml.pg"
  - "cp config/database.yml.$DB config/database.yml"
  - "echo -e 'test:\\n  secret_token: abc123\\n  secret_key_base: 123abc' > config/secrets.yml"
  - "mysql -e 'create database onebody_test'"
  - "psql -c 'create database onebody_test;' -U postgres"
notifications:
  irc: "chat.freenode.net#church.io"
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/9e05a861c78289ee0608
    on_success: change
    on_failure: always
    on_start: false

env:
  - DB=pg
  - DB=mysql
language: ruby
rvm:
  - 2.1.5
before_install:
  - "echo -e 'test:\\n  adapter: mysql2\\n  database: onebody_test\\n  username: travis\\n  encoding: utf8' > config/database.yml.mysql"
  - "echo -e 'test:\\n  adapter: postgresql\\n  database: onebody_test\\n  username: postgres\\n  encoding: unicode' > config/database.yml.pg"
  - "cp config/database.yml.$DB config/database.yml"
bundler_args: --without development production
cache: bundler
sudo: false
services:
  - mysql
  - postgresql
script:
  - RAILS_ENV=test bundle exec rake --trace db:migrate
  - bundle exec rspec
before_script:
  - "echo -e 'test:\\n  secret_token: abc123\\n  secret_key_base: 123abc' > config/secrets.yml"
  - "mysql -e 'create database onebody_test'"
  - "psql -c 'create database onebody_test;' -U postgres"
notifications:
  irc: "chat.freenode.net#church.io"
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/9e05a861c78289ee0608
    on_success: change
    on_failure: always
    on_start: false

Fix build by configuring db before bundle install
Fix build by configuring db before bundle install
