Monthly Archives: September 2008

CruiseControl Best Practices: not just for java

CruiseControl Best Practices: not just for java(image taken from Dan4th’s photostream)

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.

Do you want control or visibility?

“Enterprise” version control systems are all about … well … control. Teams that practise TDD and CI don’t need control so much because they have visibility. If you committed your changes to the wrong branch, the tests will fail. If someone checks in an unauthorised change to the release branch, it’s there to see.

Teams that don’t have the safety net need to use a big stick instead.

Link (via Software Development Today)

Branching: do it like this and nobody gets hurt

Branching: do it like this and nobody gets hurt
It’s a very simple pattern. Make a Continuous Integration build for the trunk and the release branches. Most projects don’t need anything more clever than this.

Build and Release work in London, UK

I’ve been asked if I could suggest anybody for a couple of roles. As an experimental thing I thought I’d put them out there on the blog and see if that helps anybody. Completely open to feedback here. Would you like to see the occasional job ad? Hate the idea? Like the idea but want them on the sidebar? Let me know with a comment!

Fellow Kiwi Daniel called up the other day about a Release Manager role in the City. Very well paid role. It’s more business focussed than what gets blogged about here, but I think you’d want some technical experience. Link

The other role is for one to two days a month helping out with build and release management at a small software house. It would be a coaching role, helping with the strategy, etc. You’d probably be doing freelance work already. Drop me a line at medic@build-doctor.com and I’ll put you in touch with the boss there.

Build Doctor Retrospective Season: Traffic


I had no idea how the Internet was going to respond to my little niche blog. At first, it didn’t. Slowly things built up and a pattern emerged. My audience is mostly in the USA. Almost all the traffic in the week, barely any in the weekend, and most of it driven by Google searches. For a niche blog, I think that’s fine.

Here’s the most popular pages:

1. The guest post by Michael Brunton-Spall on the Big Visible CruiseControl Status Screen (see why we stuck with “Radiator” as the name) had the highest traffic. Getting linked to from The Guardian’s blog helped.

2. Five build patterns was close behind. There’s a lot more to be done with this topic.

3. Of all the CruiseControl posts I have, this is the most popular. Tidying up the config file really seems to strike a chord with people.

4. The Ant series had the most positive comments (thanks everyone). Not surprised it’s in the top 5.

5. Antcall is evil is the post I wanted to be number one. It’s a warning to all those who are tempted by the siren umm, call of antcall. Not sure that I should have rolled up a .NET post in there as well.

In summary, I’m pretty content with it. It was difficult in the beginning but I’m learning about how to write and publicize posts. There was more readers when it was on the ThoughtWorks aggregator, but there was no feedback. Onwards and upwards.

How to make Vim and Perforce work together in three easy steps

(Vim logo from http://www.vim.org/)

Step 1: Make sure that the perforce client is in your path. Can you open a shell (or command prompt) and type ‘p4’? Do you get a help message from Perforce?

Step 2: Open the .vimrc file (on Windows, look for a _vimrc file) in your home directory. If you don’t have one, now’s the time to make it. Paste in the following and then close Vim:

nnoremap @p4a :!p4 add %:e
nnoremap @p4e :!p4 edit %:e
nnoremap @p4d :!p4 diff %

Step 3: Go to a file that is managed by Perforce (i.e. with the no read permissions). Open it. In Normal mode, type the following:

@p4e

Rejoice as Vim checks the file out for you. How to check it back in again? Do that from your command line or GUI client. There’s no such thing as a free lunch …

Tagged ,