Tuesday, February 26, 2008

cruisecontrolrb and java

I have been meaning to setup a cruisecontrol.rb instance for some time. Cruisecontrol.rb is a implementation of continuous integration build server in ruby. It is a simple self-contained download with a really quick initial setup time.

I have just started an open source java project for stack trance analysis called why and wanted a build server so thought I would give cruisecontrol.rb a go.

The download took a couple of minutes. Adding the project (cruise add why --url https://why.svn.sourceforge.net/svnroot/why) took a few more minutes to do the initial checkout.

Started cruise (cruise start) in a command shell and...build failed.

I needed to provide a custom build command in the cruise_config.rb file in projects/why:


Project.configure do |project|

project.build_command = 'b'
end


I already had a shell script called b to run ant and build the project. Result - build failed.

Small scratching of head and a chmod +x b later and - build passed.

From start to finish about 20 mins - most of which was download and initial checkout.

Sunday, February 3, 2008

Tagging builds in subversion

At the end of every build I like to add a tag to the project source repository. Although the build log contains the revision of the source being built and so the build can be re-created, I like the fact that all the information about the source and the build is in one place.



<target name="tag-build" description="tag the build revision" >
<svn javahl="false">
<status path="${basedir}" revisionProperty="svn.revision" />
</svn>
<echo message="Tagging revision ${svn.revision} as tag ${label}" />
<svn username="cruise" password="cruise" javahl="false">
<copy srcURL="http://repository/path/trunk" revision="${svn.revision}" destUrl="http://repository/path/tags/${label}" message="Cruise: Tagging build ${label}" />
</svn>
</target>