tobyqin / ccnet.svnrevisionlabeller

Automatically exported from code.google.com/p/svnrevisionlabeller
0 stars 0 forks source link
ccnet plugins

SVN Revision Labeller

SVN Revision Labeller is a plugin for CruiseControl.NET that allows you to generate CruiseControl labels for your builds, based upon the revision number of your Subversion working copy.

Requirements

Installation

Two builds are provided - Debug and Release. You should only need the Debug build if you are diganosing technical issues with the plugin. Just drop the contents of either src\ccnet.SvnRevisionLabeller.plugin\bin\Debug or src\ccnet.SvnRevisionLabeller.plugin\bin\Release into the folder that CruiseControl.NET is running from, update ccnet.config with the appropriate configuration (see below), and restart the service.

Configuration

Below is a sample configuration for svnRevisionLabeller, showing the mandatory fields:

svn://localhost/repository/trunk

The following sample configuration shows the complete set of fields:

8 2 0 Prerelease {major}.{minor}.{build}.{revision} false false https://localhost/repository/branches/dev-project C:\Svn\Bin\svn.exe ccnetuser ccnetpassword 25/10/2010

Usage

When CruiseControl.NET begins a project build, it generates a label for the build and stores it in the property CCNetLabel - this property can then be used by NAnt or MSBuild to generate the AssemblyInfo.cs for your assemblies, so that CC.NET displays as its label the same version that the assemblies are built with. So, if the configuration for the labeller is set as:

7 11 svn://localhost/repository/trunk

and the latest Subversion revision number is 920, the CCNetLabel will be set to 7.11.0.920. Forcing a build without any changes to the repository will not make any changes to the label. A subsequent commit to the repository would then set the label to 7.11.0.921, and so on.

If you want to generate a more complex label, you use the Pattern field. This contains a number of tokens for the Major, Minor, Build, Revision and Rebuilt numbers,and you can effectively create any label you want. For instance:

1 2 Labelling is as easy as {major} - {minor} - 3 - {revision}. See? svn://localhost/repository/trunk

and the current revision is 4, then the generated build label be "Labelling is as easy as 1 - 2 - 3 - 4. See?"

The available tokens are:

{major} - the major build number
{minor} - the minor build number
{build} - the build number 
{revision} - the revision number
{rebuild} - the number of times the build has been rebuilt (i.e. a forced build)
{date} - the number of days elapsed since the date specified in the startDate field
{msrevision} - the revision number that Microsoft calculates - the number of seconds since midnight, divided by two

History

3.1.0.32163

1.0.3.25899

1.0.2.16573

1.0.1.21635