CruiseControl + SVN

February 16th, 2007 by Hen

Shannon Krebs pointed out in a comment to my last CruiseControl post that the svnbootstrapper can be used to update the project. I’d discounted this because the docs say “Handles updating a single file (typically build.xml and/or build.properties) from a Subversion repository before the build begins. “. ie) It’ll update build.xml, then you can call something on build.xml to update the rest.

Prodding it a bit, it does run quite happily for the whole project if you use the localWorkingCopy attribute. There is still one problem with this. From the docs - “Bootstrappers are run before a build takes place, regardless of whether a build is necessary or not”. This is irritating, I don’t want to run svn update every time, just when a build is needed. Having an attribute to each bootstrapper of ‘if-build-required=”true”‘ seems like that would solve things.

Looking at the above brings to mind a definite complaint I have with CruiseControl. It’s error handling when parsing the configuration file is non-existent. It just falls over and prints the help message.

Shannon talks about moving to Hudson. Shannon dislikes that there is a configuration file in CruiseControl - I definitely fall into the camp of looking at things like CruiseControl and Hudson and wincing at the thought of having my configuration stuck inside a GUI. I want to store the config in SVN and edit with a powertool (vim!) and not have to use a painful HTML form.

Jason Yip points out that there is discussion on fixing this: CC-320.

3 Responses to “CruiseControl + SVN”

  1. Phil Wilson Says:

    “I don’t want to run svn update every time, just when a build is needed.”

    That’s quite an interesting statement. When do you see a build being needed that doesn’t use the latest code?

  2. Henri Yandell Says:

    What I mean Phil is that I don’t want svn update running when a build is not needed. If I use the svnbootstrapper, then everytime it looks to see if a build is needed (ie: svn -u status or svn info) it will also run svn update.

    This is an unnecessary load on the server.

  3. Shannon Krebs Says:

    Configuration files do have their place. I’ve certainly setup some complicated builds before in CC that you want to be able to hack around with the config file (and be able to restore a previous version when you mess it up).

    If you are using something like maven for your builds in theory all of the information you need to build your project should already be defined in the pom file. So all your CI server should need from you is the link to where it can download the pom file and what goal to run. Which makes a web interface easier (in my opinion). Ultimately it depends on the project and what you are using to build it. I good CI server should provide both options. I think CC has made some moves towards a web config interface recently, but the last release I tried it was only experimental.

    (In the case of maven, I guess you are really just substituting the config file in your CI server for the maven config file in your project.)