As an alternative to the XML that you already mentioned, you can use remote access, as the CCTray application does. If you link to ThoughtWorks.CruiseControl.Remote.dll from the CruiseControl.NET \ server folder, you can create an instance of CruiseServerRemotingClient and use it to extract information from the server.
The following snippet prints a list of projects on the server and their build statuses:
CruiseServerRemotingClient client = new CruiseServerRemotingClient("tcp://ccnetserver:21234/CruiseManager.rem"); ProjectStatus[] statusList = client.GetProjectStatus(); foreach (ProjectStatus status in statusList) { Console.WriteLine("{0}: {1}", status.Name, status.BuildStatus); }
You can also get the log for the latest build in XML format as follows:
string buildName = client.GetLatestBuildName("Jasenje"); Console.WriteLine(client.GetLog("Jasenje", buildName));
I could not find any real documentation for the API, but at least there are XML comments with brief descriptions of the methods and parameters.
Damir arh
source share