CruiseControl Best Practices: not just for java

In the beginning, there were programmers. The programmers quickly discovered integration pain:

"Bob! You broke the payments module again!"

Eventually a couple of guys felt the integration pain, thought "forget that" and wrote CruiseControl. This was in the days of CVS, java 1.2, and XML being considered kind of avant-guarde.

Cruisecontrol has a strong Java heritage. Does that rule it out from being used to build other languages? Nope. Don't think that it has stopped it being functional in Ruby, .NET or other languages. In this post I'm going to write about how to take CruiseControl off the well-trodden path .

There are several approaches you could use: wrapping in Ant, using the exec Builder, or using some of the new dedicated Builder. Here goes:

Wrap your build in Ant

CruiseControl and Ant go together like bread and butter. CruiseControl and Maven work very well together too, except that Maven would rather butter the bread for you. So it's very easy to wrap your build tool in a small Ant build. I'd recommend that you do this if you're in a hurry. It's very easy to take all the special properties that CruiseControl passes to Ant, and pass them down to your build, via command line arguments or environment variables.

Exec it

CruiseControl now sports an ExecBuilder plugin that will call to your shell (be it DOS or Unix) to invoke your real build. In Release 2.7.3, it's also able to pass properties to your executable, via shell environment variables.

Use the right Builder for the job

Even before CruiseControl.rb was released, CruiseControl had a RakeBuilder. CruiseControl.NET only existed because a client of ThoughtWorks had refused to let Java code onto their systems. Before that, they'd use CruiseControl with the NantBuilder. PHP projects can use the Phing build tool with the PhingBuilder, and you can even chain two Builders together with the CompositeBuilder.

I think there's still value in CruiseControl. Hudson may be steaming along, ThoughtWorks now sell Cruise ( heck, I could never get the developers to submit patches when I worked there and they were running all their projects on it), but CruiseControl is still there and sill building a lot of projects around the world. If you look at the mailing list, there's a flurry of activity at the moment. It's all good.

DevOps New Zealand