Enabling CI for github projects

I’ve noticed a couple of times on visiting miscellaneous github projects that there’s been a little logo indicating the state of the CI build. Hmm, thought I… I guess there’s some service out there that can be configured. Probably a bit of a pain to get going. Maybe one day, but not today, I thought.

But today I took a deeper look, and had a go at configuring CI using travis-ci.org. And it turns out I was wrong… it’s trivially easy to get going (for my Maven-based Java projects, at any rate).

Step 1: register at travis-ci.org, with your github credentials. Travis needs them to find your repositories and to install its git commit hooks.

Step 2: per this doc, create a .travis.yml file, with the content:

language: java

Step 3: update your README.ps1 with the link to the image. Eg for my java-testsupport project, the text to include was:

[![Build Status](https://travis-ci.org/danhaywood/java-testsupport.png?branch=master)%5D(https://travis-ci.org/danhaywood/java-testsupport)

Step 4: Back in travis-ci.org, go to your profile page and flip the switch for the github repo(s) that you’ve configured:


Step 5: push your change, and let Travis do its thang. After a minute or two, the home page should show the status of all your builds, with a console view for any that failed:


Step 6: over on your github page, you should be able to see the status too:


And honestly, that’s all there is to it. Ridiculously easy.

About these ads

Posted on July 15, 2013, in Uncategorized and tagged , , , , , . Bookmark the permalink. Leave a comment.

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


Get every new post delivered to your Inbox.

Join 292 other followers