views:

146

answers:

3

I have one project which is under Cruise control. I want to write one console application which will write the last build label of that project in one text file.

+1  A: 

CruiseControl passes CCNetLabel argument to script that it invokes. You can just print this out to a file from the script without writing a console application.

If you need to retrieve project version from outside of the CruiseControl, then you can either access this file (i.e.: by exposing it via IIS) or poll and parse XML report of CruiseControl dashboard (which is located at http://BuildServer/XmlServerReport.aspx)

Rinat Abdullin
A: 

Maybe it's not an answer you were looking for, but how about writing a custom publisher which would publish the build label to a file once a (successful) build is done?

Grzegorz Oledzki
A: 

Depends on what flavour of cruisecontrol you use ? For default, java version, i have something like this

<schedule showProgress="true">
  <composite showProgress="true">       
    <exec timeout="2400" command="${homedir}/bin/updatebuildid" args="${sbhomedir}/projects/${project.name} ${label}"/>
    ..... etc ..

And updatebuild script is basicly a shellscript for invoking sed to add a postfix to a version number in the packaging files. for you it could be just simple "echo $1 > $yourfile"

rasjani