Continous Integration with Circle or: Coming Full Circle

Home » Blog » Software » Web Applications » Continous Integration with Circle or: Coming Full Circle

I’ve recently tried out Circle, a hosted continuous integration service, and I’m quite thrilled about it.

Automate all the things

Registration / login works via GitHub. Once logged in, Circle lets you choose a GitHub repository and starts the first build right away. Circle claims that setup is as easy as:

  • Sign up to Circle,
  • Give Circle permission to access GitHub on your behalf,
  • Click on a project repository

From my experience so far this claim is absolutely correct. Configuration is completely automatic. I’ve only tried it with Rails so far but according to their documentation node.js, Java and Python should work just as fine as Ruby.

Circle’s build process works via GitHub’s post commit hooks. Once Circle is notified of a new commit a new build is triggered and your automated tests will be run. Upon build or test failure you’ll receive a notification via eMail. What is more, Circle even allows for continuous deployment. If your build is successful you can have Circle automatically deploy a new version of your application to Heroku or Google App Engine.

Coming full circle

Having a nice process for automatically building, testing and deploying my app in place I wanted to see if I can still take this a little bit further. I was wondering if it is possible to automatically create a GitHub issue upon a failed build. As a matter of fact, it is:

Circle’s has a post build webhook feature that allows you to call external URLs upon build completion. So, I created a Zapier job (or ‘Zap’ as they like to call it) that consumes the build results (which are provided as a JSON data structure) and creates a GitHub issue if the current build has failed and the previous one hasn’t. In order to provide Zapier with the field names Circle uses in its JSON payload I manually called the Zapier webhook once with a sample build result payload (using curl). After that Zapier let me choose the values I wanted to be included in the GitHub issue such as an error description and a link to the failed build. Everything else worked automatically.

So, now I have a comprehensive, commit-triggered build process including testing, deployment and issue tracking. Pretty nifty.

About the author: Bjoern
Independent IT consultant, entrepreneur

Leave a Comment