CruiseControl.Net offers several ways to get feedback from the continuous integration builds, including emails, web dashboard and system tray notification with an application called CCTray.
CCTray allows you to pick which project to monitor, but doesn’t yet allow you to monitor several projects at a time (I’m confident this will change sooner or later).
I wrote this small NAnt script which setups and spawns multiple instances of CCTray, using information found in the CCNet configuration file. This way I can be aware of the state of all builds at a glance, without checking a web page or my emails.
<?xml version="1.0" encoding="utf-8" ?>
<project xmlns="http://nant.sf.net/schemas/nant-0.85.win32.net-1.0.xsd"
default="launch.trays">
<script language="C#" prefix="utils">
<imports>
<import name="System.Xml"/>
<import name="System.Text"/>
</imports>
<code><![CDATA[
[Function("select-nodes")]
public static string SelectNodes(
string filename, string xpath)
{
XmlDocument doc = new XmlDocument();
doc.Load(filename);
StringBuilder buffer = new StringBuilder();
foreach (XmlNode node in doc.SelectNodes(xpath))
buffer.AppendFormat("{0},", node.Value);
return buffer.ToString();
}
]]></code>
</script>
<target name="launch.trays">
<property name="cctray.source.folder"
value="c:/integration/tools/ccnet/cctray"/>
<property name="cctray.instances.folder"
value="c:/integration/cctrays"/>
<property name="ccnet.config"
value="c:/integration/ccnet/ccnet.config"/>
<exec program="pskill.exe"
commandline="cctray" failonerror="false"/>
<delete dir="${cctray.instances.folder}"/>
<foreach item="String"
in="${utils::select-nodes(
ccnet.config, '//project/@name')}"
delim="," property="projectname">
<property name="ccfolder"
value="${cctray.instances.folder}/${projectname}"/>
<copy todir="${ccfolder}">
<fileset basedir="${cctray.source.folder}">
<include name="*"/>
<exclude name="cctray-settings.xml"/>
</fileset>
</copy>
<copy todir="${ccfolder}" verbose="true">
<fileset basedir="${cctray.source.folder}">
<include name="cctray-settings.xml"/>
</fileset>
<filterchain>
<replacestring
from="<ProjectName>MyDefaultProject</ProjectName>"
to="<ProjectName>${projectname}</ProjectName>"/>
</filterchain>
</copy>
<exec program="cmd.exe"
commandline="/c start ${ccfolder}/cctray.exe"/>
</foreach>
</target>
</project> Though this approach obviously doesn’t scale very well, as each CCTray instance requires almost 20MB, it fits my needs and my configuration.
I also customized CCTray texts to get more precise information per project:
<replacestring
from="Yet another successful build!"
to="Another successful build for ${projectname}!" />
<replacestring
from="The build is still broken..."
to="Project ${projectname} is still broken" />
<replacestring
from="Recent checkins have fixed the build."
to="Recent checkins have fixed ${projectname}" />
<replacestring
from="Recent checkins have broken the build."
to="Project ${projectname} is now broken" />