views:

144

answers:

2

I have made a C# application and I am trying to figure out if I can tap into build events of cctray (cruise control tray)? I don't want to re-invent the wheel, I just want to know when my builds fail or succeed (on a client machine) so than my custom C# application may execute a specific set of routines.

A: 

Any reason why you can't use your build tool to do that?
e.g. in Nant, you can specify the target to be executed when the build fails or succeeds by using the nant.onfailure and nant.onsuccess properties. In the build targets, you could call your C# application via execute tasks.
CruiseControl has onSuccess and onFailure publishers... but strangely can't find them in CruiseControl.net.

Gishu
The reason is that I work for a Large corporation and getting access to do that on the build servers is hard to do. Instead, we want a client machine to listen to the builds and respond with outside processes.
Phobis
A: 

You could add the CruiseControl remote library as a refrence and create an instance of CruiseManagerFactory and this line will get you the status of all the projects. ServerUri is a string in the format of tcp://ServerName:Port/CruiseManager.rem

ProjectStatus[] currentStatuses = managerFactory.GetCruiseManager(ServerUri).GetProjectStatus();

in this example I obviously named my instance of CruiseManagerFactory managerFactory. The array of ProjectStatus then has the current status of all the projects at the address of ServerUri.

Alex