Url to get latest build # of CC.NET project?
I have CruiseControl.NET version 1.4.4.83, and I am wondering if there it provides a url where the only control is the lastest build # of a project, so that I can access that data using curl or something?
Something like http://buildserver/ccnet/server/VMSDEV2/project/MyProject/LatestBuild.aspx
All that it would have is:
0.0.0.31
Update:
Fixed the IPlugin issue with an attribute for the class:
[Exortech.NetReflector.ReflectorType("latestBuildNumberProjectPlugin")]
public class LatestBuildNumberProjectPlugin : ICruiseAction, IPlugin
{
public static readonly string ACTION_NAME;
private readonly IFarmService farmService;
private readonly ILinkFactory linkFactory;
static LatestBuildNumberProjectPlugin()
{
ACTION_NAME = "LatestBuildNumber";
}
public LatestBuildNumberProjectPlugin(IFarmService farmService, ILinkFactory linkFactory)
{
this.farmService = farmService;
this.linkFactory = linkFactory;
}
public IResponse Execute(ICruiseRequest cruiseRequest)
{
IProjectSpecifier projectSpecifier = cruiseRequest.ProjectSpecifier;
IBuildSpecifier[] mostRecentBuildSpecifiers = this.farmService.GetMostRecentBuildSpecifiers(projectSpecifier, 1);
if (mostRecentBuildSpecifiers.Length == 1)
{
var build = mostRecentBuildSpecifiers[0].BuildName;
var response = new HtmlFragmentResponse(build);
return response;
}
return new HtmlFragmentResponse("There are no complete builds for this project");
}
public INamedAction[] NamedActions
{
get
{
return new INamedAction[] { new ImmutableNamedAction(ACTION_NAME, this) };
}
}
public string LinkDescription
{
get { return "Latest Build Number"; }
}
}
And I've named my assembly:
ccnet.latestBuildNumberProjectPlugin.plugin.dll
And in the dashboard.config file, I've added the plugin ref:
<projectPlugins>
...
<latestBuildReportProjectPlugin />
...
</projectPlug开发者_如何转开发ins>
But apparently, var build = mostRecentBuildSpecifiers[0].BuildName;
is not what I am looking for.
I believe it is possible to create packages to extend the CC.NET Dashboard (i.e. the website) and completely change the interface.
To help you get started, check the CC.NET documentation.
A few links that could be of help.
- Developing Web Dashboard Plugins
- Building Packages
- Configuring the Web Dashboard
HTH,
The link to the latest build is:
http://myserver.com/cc_net/server/local/project/myproject/ViewLatestBuildReport.aspx
it will expand in :
http://myserver.com/cc_net/server/local/project/myproject/build/log20100618165244Lbuild.45.xml/ViewBuildReport.aspx
Inside the html page, you have your build number.
精彩评论