Category Archives: Build

I like to describe my job at ThoughtWorks as helping Developers and Operations realize that they’re playing on the same team. No matter how awesome your code is, how elegantly you’ve solved the problem at hand, how nice and readable the code is - if you can’t get it into production your software is just a collection of bits. Likewise, you can have the best network, the most scalable hardware, the neatest cable patching scheme - but it’s just a big fancy heater if it’s not running the code your business needs.

As I’m normally brought in with the developers, I’ve been trying to find efficient ways to engage with the client Operations teams. Normally I end up having one on one conversations with various members of the team, try to find out what their current processes are, what their major challenges are and what their concerns are regarding the project I’m involved in. I usually do this to keep the safety levels high. The problem though is that it takes quite a lot of time and effort to get things going and get some momentum going.

At my current client though I didn’t have the time or access to the people to do things the normal way. A meeting was arranged with the key Operations stake holders and I effectively had just 2 hours to explain our development process in general, and Continuous Integration and Build Pipelines in detail. While talking with Graham Brooks about what we wanted to cover, he came up with the idea of running it as a mini retrospective.

After the usual introductions, we gave them 15 minutes to list the Good, the Bad and the Puzzles of their current development and release process. We had good participation from the group and as expected had a high number Bad entries. After talking through the cards and grouping them into related sections, we then allowed them to vote on the ones they most wanted to talk about. Most votes went to the core pain points, and we spent the rest of the time talking about how our process would address those issues. It also helped a lot that most of the Good entries related to the automation they already have in place…

By the end of the meeting no was talking about the bad old days (lobbing releases over the wall). Everyone was engaged starting to get some spirit of collective ownership going in the whole delivery process and that breaking down the walls that exist between the various silos was high on the list of things to do. Rather than talk to them about our process and how we would like to interact with them, we had allowed them to lead the discussion on which elements from our toolbox would have the greatest value for them.

All I need to do now is learn how to be as good a facilitator as Graham was…

Early last year I did a Quick Comparison of some of the popular CI servers of the time. Things have moved on since then, and I’ve actually been involved with the Cruise development team since then. Now that Cruise has been released, a number of people both inside and outside ThoughtWorks have asked me to put together a follow up article – here it is.

The list of available products out there has grown a lot in the past 18 months, and the features that they support are really great. Since I did the last review I’ve actively avoided having a look at the other tools out there to keep a clear focus on what I wanted to see in Cruise. Doing this review has been a great way for me to see what everyone else has been up to.

Just having loads of features does not automatically make for a good tool though. Instead of having a shooting match between who does what, I’ve taken a little sample Java servlet that I use for demos and tried to get it working with all the tools. This project is hosted on a local subversion repository. I’m going to try set it up to simply run unit tests and create my distributable .war file. Areas that I’m going to look at are:

  • Installation (on Linux, OSX and Windows)
  • Setting up my existing project
  • What did the tool inspire me to try next

Tools that I’ll be trying out are (in alphabetical order):

Read More »

I’m busy adding the finishing touches to my talk for JAOO this year and I’ve just realised that I’ve not let you guys know that I’m going to be there. Consider yourself warned.

Last year at the conference I got a chance to show off the new UI we did for CruiseControl with Erik Dörnenburg. Afterwards I was having a chat with Martin Fowler, and I commented on how I’d like to see a whole track at JAOO dedicated to Building and Deploying software. While I’m sure I can’t take all the credit for it, this year there is going to be a short Build track with me talking about Continous Integration. Hope to see you there…

I had one of those rare opportunities today when I got to pair with one of the developers on our project. The story he’s working on has to do with generating usage documentation for a webservice at runtime. What he wanted was a list of source files to be available at runtime. The solution he came up with (which does work) was the following Java program:

package com.example.service.utils;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;

public class ListControllers {
    public static void main(String[] args) throws IOException {
        String outputFile = args[0];
        String srcDir = args[1];
        File f = new File(srcDir);
        File serverDir = new File(f, "com/example/service/server");
        String[] entries = serverDir.list();
        Arrays.sort(entries);
        BufferedWriter writer = new BufferedWriter(new FileWriter(outputFile, false));
        for(String entry : entries) {
            if(entry.endsWith("Controller.java")) {
                writer.write(name + "\n");
            }
        }
        writer.flush();
        writer.close();
    }
}

This was then called by the following Ant snippet:

<mkdir dir="${target.dir}/war/WEB-INF/classes"/>
<java classname="com.example.service.utils.ListControllers"
      classpath="${main.jar}" failonerror="true">
    <arg value="${target.dir}/war/WEB-INF/classes/controller.list"/>
    <arg value="${src.dir}"/>
</java>

This was then bundled up in the war file so that he could get his mits on it at runtime. It works, but is not without problems. My primary complaint is that it makes the build harder to understand. To figure out what’s going you need to find and open up the .java file, and be able to understand Java in the first place.

After a few minutes of pairing we managed to fix it with the following Ant snippet:

<mkdir dir="${target.dir}/war/WEB-INF/classes"/>
<pathconvert property="controller.list.propery"
             pathsep="${line.separator}">
    <sort>
        <path>
            <fileset dir="${src.dir}/com/example/service/server"
                     includes="*Controller.java"/>
        </path>
    </sort>
    <map from="${src.dir}/com/example/service/server/" to=""/>
</pathconvert>
<echo message="${controller.list.propery}"
    file="${target.dir}/war/WEB-INF/classes/controller.list"/>

Not only is it now easy to see what we’re trying to do in the build file, but we managed to replace 29 lines of Java + Ant with 10 lines of Ant. Sweet!