views:

28

answers:

2

I have a VS 2008 web forms project and I'm using CruiseControl.net to build and test the app. All fairly straight forward.

What I'd like to do is automate the publishing to a given folder, and have the folder named ProjectName_VersionNumber_BuildNumber. I can build to a statically named folder, but I can't see how to name the folder automatically. How can I detect the version number and build number in cruise control scripts?

A: 

You can publish to a subfolder named with the build label - look for UseLabelSubdirectory in the documentation.

Or you could use a custom task - ccnet will set a bunch of environment variables before executing it, including one for the build label.

Blorgbeard
+1  A: 

CruiseControl passes a lot of properties (integration properties they call them) to your tasks. How you use them will depend on which task you are using. For example, here is a list of the properties for MSBuild. Here are the properties that I think you want based on your question:

CCNetLabel: The label used to identify the CCNet build. This label is generated by the CCNet labeller.

CCNetProject: The name of the CCNet project that is being integrated.

All you would have to do is write something like this to create the folder name:

${CCNetProject}_${CCNetLabel}

The rest of the available integration properties can be found here.

TskTsk