Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continuous Integration for Ruby on Rails? [closed]

People also ask

How long does a continuous integration build run for?

What is Continuous Integration? Continuous integration (CI) is a software development practice in which developers merge their changes to the main branch many times per day. Each merge triggers an automated code build and test sequence, which ideally runs in less than 10 minutes.

How do I enable continous integration?

Continuous integration in five stepsStart writing tests for the critical parts of your codebase. Get a CI service to run those tests automatically on every push to the main repository. Make sure that your team integrates their changes everyday. Fix the build as soon as it's broken.

Is continuous integration mandatory?

Continuous Integration is a development methodology that involves frequent integration of code into a shared repository. The integration may occur several times a day, verified by automated test cases and a build sequence. It should be kept in mind that automated testing is not mandatory for CI.

Which pipeline is used for continuous integration?

A continuous integration and continuous deployment (CI/CD) pipeline is a series of steps that must be performed in order to deliver a new version of software. CI/CD pipelines are a practice focused on improving software delivery throughout the software development life cycle via automation.


I just went through the options here and thought I'd roll them up as of late 2011.

Integrity

After a near-death experience that left the still-linked-to website with outdated information and downed the demo site, this project has a spark of life again. But the documentation hasn't moved on, and lots and lots of the steps in the tutorial are just plain broken; I had to change references to gems, build some things out of band, and then I still couldn't get it working.

Cruise Control.rb

Dead simple: you just download it, run a command line to add your project (there is no UI for doing so), and run the Rails app. But there's no UI for editing your project, either, and there's no real integration with build artifacts aside from displaying links to them: you get no graphs of tests run, no trend lines, etc. I also had to adjust the routes.rb file to get the code linking working (the resources :projects line needs to move below all the other non-default routes).

TeamCity

This looks awesome, but the pay scale seems out of whack. 3 agents free and then when you're dependent you need to dole out hundreds of dollars. Personal Builds looks great, but don't have the budget.

Jenkins (née Hudson)

This is a Java stalwart and it is loaded up with a thousand options, so the UI is confusing and it's a chore to set up your projects. But once you set it up you get a whole lot of plugins that can pull from most anywhere, run most anything, and report most everything. The OS X Installer points Jenkins at /Users/Shared/Jenkins/Home but fails to create that directory or chown it to daemon (which is uses by default, and you should change to a new jenkins user so you can set up GitHub integration).

Others

I didn't really try these, but thought I'd mention why:

  • CI Joe wants to own the GitHub repo more than I want it, and its creators aren't even using it; they're on Jenkins.
  • Cerberus seems neatly small but doesn't have a UI and doesn't automatically publish build artifacts where others can see them.
  • BigTuna seems to be a CruiseControl.rb clone without the (already minimal) community support.
  • Bamboo looks really neat if you use JIRA and BitBucket, but we use neither. It does deploys but we already have those set up in Capistrano.

The Choice

We went with Jenkins, but I really wish one of the lighter-weight solutions had worked out.


How about CruiseControl.rb?

Same crowd that did CruiseControl (thoughtworks) and written in Ruby. Very easy to use Rake to integrate your other tools, and can use the ruby-growl gem for your notifications.


You might also want to consider Hudson. It is designed for use with Java projects although there is a great selection of plug-ins available including support for Ruby and Rake. It has a very useful web interface and supports email notifications as well as many others (like twitter, or giant bear lamps).

The community is also very active and there have been several articles on hooking up Hudson with Selenium which you might be helpful for testing Rails applications on the browser side.

Another one look at is Team City which is free for small projects and teams (including commercial). I really like Team City and have used it before for other projects but currently we're using Mercurial for source control and Team City's support was a little too beta when we were considering it.

I switched from CruiseControl.net to Team City and was absolutely shocked at the improvement. I'm partial to Hudson though because of its similar feature set and very active community.


Circle is an advanced CI service for Rails (and other web apps). From your list, it supports the following:

  • Git and Test::Unit integration (also RSpec, Cucumber, Jasmine, Konacha integrations, and supports arbitrary extra test commands)
  • Integration with Rake and/or Capistrano (uses Rake to run commands and set up DBs, support continuous deployment using Capistrano or Heroku, or anything really)
  • A web interface showing the status of the build
  • Email notification of failed builds.
  • Desktop notification (through CCMenu/CCTray)
  • REST API for build statuses
  • Plugin framework for running other code analysis tools and reporting results in the UI (we can run arbitrary commands and support including their status as part of the build)

Joel and I spent a while chatting about this on the Stackoverflow podcast - check it out!


(edit) Disclaimer: Paul Biggar founded Circle as he states in his Stackoverflow profile


Semaphore is a new hosted CI app for Ruby and Rails apps. It integrates with GitHub, requires no setup and has a simple UI.