Anyway, here are the steps I took to make it work for our app:
-
go here and have the repo owner log into travis using github oAuth
-
once you're logged into travis, you'll notice that your repo list is empty. go to the top right of the nav, drag down and click 'Accounts'. Turn the switch to 'on' for which repo you want travis to run on
-
visit the github service hooks page (located under repo -> settings) and you should see that the travis hook has been activated with your github username and travis token. if not, fill those in
-
add a '.travis.yml' file to your repository (where Rakefile and Gemfile are- not in a folder Here's what mine looked like:
language: ruby rvm: - 1.9.3 env: - DB=postgresql script: - RAILS_ENV=test bundle exec rake --trace db:migrate #test before_script: - psql -c 'create database ops_hospital_mapper_test' -U postgres -
After you write your .travis.yml file, go to this page, copy and paste your file and make sure that you're green
-
go to your config/database.yml file and write something like this:
postgresql: &postgresql adapter: postgresql username: postgres password: database: YOUR_APP_NAME_<%= Rails.env %> min_messages: ERROR defaults: &defaults pool: 5 timeout: 5000 host: localhost <<: *<%= "postgresql" %> development: adapter: postgresql encoding: utf-8 database: ops_hospital_mapper_development host:localhost staging: adapter: postgresql encoding: utf-8 database: ops_hospital_mapper_staging host:localhost test: adapter: postgresql encoding: utf-8 database: ops_hospital_mapper_test host:localhost
7.Commit and push to a branch in git. If you go to your travis home page, you will see that travis runs test on the commit you just made to ensure that your specs all pass.