Package net.haefelingerit.tagmod

A package to extend CruiseControl.

See:
          Description

Class Summary
Parser This class implements a parser to analyze a log file containing tag operations.
Plugin This class implements a SourceControl element to be plugged into CruiseControl as a method to detected modifications.
Static This class contains static methods only.
 

Package net.haefelingerit.tagmod Description

A package to extend CruiseControl.

CruiseControl is more than just a continuous integration system. It is also a framework that can be teached to do all kind of things automatically in case a particular change in an almost arbitrary environment is detected.

This package is about teaching CruiseControl to detect weather a tag has been assigned or removed from a source code repository[1] which - up to version 2.8.2 of CruiseControl, is not possible out of the box.

Install this plugin into CruiseControl by putting all classes of this package into CruiseControl's classpath[2]. In addition edit the configuration file. Here is a sample how your configuration file would look like:

<cruisecontrol>
<plugin name="tagmod" classname="net.haefelingerit.tagmod.Plugin" />

<project name="release-foo_bar">
    <modificationset>
      <tagmod project="foo/bar" tagvalue="r-\d+_\d+_\d+" Stem="tagmod" />
    </modificationset>

    <schedule>
      <ant target="release-foo/bar" <ant>
    </schedule>
  </project>
</cruisecontrol>

Use CruiseControl's plugin tag to register class Plugin. In addition to shown above, you can also predefine attributes to your liking.

The usage example further below shows how to use this plugin to make a release build if a tag has been assigned to a project named foo/bar. If a tag has been assigned and if the tag's value matches the regular expression r-\d+_\d+_\d+ (for example r-1_32_0), then an ant build with target release-foo/bar is triggered. If a tag exists which would not match the expression or would be deleted or moved, then nothing would happen.

Within the build process it is important to know what exactly needs to be build. From the target in the example above it is clear, that a release build of project foo/bar needs to be done. Equally important for the build script is of course to know about the version to be build. To support this, the tag value - amongst other things - will be passed to the build script. Using ant as shown above, properties are being passed. Each property can be prefixed with a stem to avoid clashes with properties used by the script.

The properties passed are

where tag is the tag value, tagdate is the timestamp when the tag has been recorded (this timestamp has the format yyyy-MM-dd HH:mm:ss 'UTC'), where taguser is the user initiating the tag[3] and where tagop is the tag operation carried out[4].

Wen reading so far you may think that registering and using the plugin is all you need to do. This is actually not the case. In order to get things up and running, a script (which is part of the overall package) must be plugged into the (CVS) server to record tag related actions. Additionally, this tag log file must be made available to the CruiseControl server (i.e. to this plugin). By default the name of this log file is tag.log and assumed to be available in the folder from where CruiseControl got started.

[1] the only repository supported by today is CVS

[2] usually done by putting this project's artefact (a jar) into CLASSPATH

[3] warning: this can be a system user when using CVS!

[4] either mov (forced assignment), del (deletion) or add (regular assignment)



Copyright 2009. All Rights Reserved.