Rails snippet: Setting up TravisCI

Travis CI is great way to get continuous integration into a project.
So just to get started here is a quick walkthrough, through the setup for a
project of mine. Basically it’s a 3 step process:

Setup rake to run the tests

This is easy, and probably already happens anyway! Just to check

$ rake

Setup .travis.yml

My own .travis.yml for
ActiverecordTranslatable looks like this:

http://gist-it.appspot.com/github/sideshowcoder/activerecord_translatable/blob/master/.travis.yml
So line by line

http://gist-it.appspot.com/github/sideshowcoder/activerecord_translatable/blob/master/.travis.yml?slice=0:2
Set the ruby version to 1.9.3

http://gist-it.appspot.com/github/sideshowcoder/activerecord_translatable/blob/master/.travis.yml?slice=3:5
Setup the database for the tests

Setup a github hook to notify travis about commits

Now to complete the setup setup the hook for travis under the Settings → Service Hooks on Github.

So now quick, learn more checkout TravisCI docs it’s
awesome.

Enjoy

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s