Url获取CC.NET项目的最新版本?

时间:2010-07-06 23:48:26

标签: cruisecontrol.net

我有CruiseControl.NET版本1.4.4.83,我想知道它是否提供了一个url,其中唯一的控件是项目的最新版本#,以便我可以使用curl或其他东西访问该数据?

http://buildserver/ccnet/server/VMSDEV2/project/MyProject/LatestBuild.aspx

这样的东西

所有这一切都是:

0.0.0.31

更新

使用该类的属性修复了IPlugin问题:

[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"; }
    }
}

我已经命名了我的集会:

 ccnet.latestBuildNumberProjectPlugin.plugin.dll

在dashboard.config文件中,我添加了插件ref:

    <projectPlugins>
        ...
        <latestBuildReportProjectPlugin />
        ...
    </projectPlugins>

但显然,var build = mostRecentBuildSpecifiers[0].BuildName;并不是我想要的。

2 个答案:

答案 0 :(得分:1)

我相信可以创建包以扩展CC.NET Dashboard(即网站)并完全更改界面。

为了帮助您入门,请查看CC.NET documentation

一些可能有帮助的链接。
- Developing Web Dashboard Plugins
- Building Packages
- Configuring the Web Dashboard

HTH,

答案 1 :(得分:0)