Category Archives: Cruisecontrol.Net

Generate CruiseControl.Net Build Report in Powershell

Recently, I wanted to generate report of all the builds happening on my system. I came up with a very simple solution using Powershell script.

If you look at the CC.Net directory structure, you can find that all the project specific logs are kept at <CC.Net>server<project-name>ArtifactsBuildLogs (in Default config)

So, if you have a project named MyFirstProject…

it will be in the <CC.Net>serverMyFirstProjectArtifactsBuildLogs

further the log files names also follow a pattern

for example, take this:

log20101125115243Lbuild.4.xml

this consists of log+<year>+<month>+<day>+<hour>+<min>+<sec>+LBuild.<build-label>.xml, so from the file name above, we can know that:

Year = 2010, month = 11, day= 25; hour = 11, min = 52, sec = 43.

If build had failed, then the file name changes to :

log+<year>+<month>+<day>+<hour>+<min>+<sec>.xml, that is the Build-Label is missing.

So I quickly wrote this powershell script, which spits out results as CSV.

Project Name, Date of Build, Build-Label, Status

_____________________________________________________________

___________________________________________________________

Hmm… Powershell is really powerful :)