【问题标题】:How to add cruisecontrol.net build step based on output of .NET code如何根据 .NET 代码的输出添加 Cruisecontrol.net 构建步骤
【发布时间】:2011-08-25 13:52:59
【问题描述】:

我编写了一些代码,使用 IIS SEO 工具包 API 检查站点是否存在损坏的链接。代码界面美观简洁,见下图:

public interface ILinkChecker
{
    /// <summary>
    /// Checks links in the website containing the supplied URL and returns a LinkCheckSummary instance detailing the results.
    /// </summary>
    /// <param name="url">The URL.</param>
    /// <returns>A LinkCheckSummary instance detailing the results of the check.</returns>
    LinkCheckSummary CheckLinks(string url);
}

我可以通过检查返回的LinkCheckSummary对象来确定是否有断开的链接。

我现在想将它集成到我们的 Cruise Control CI 管道中,这样如果 LinkChecker 检测到断开的链接,构建就会断开。

我该怎么做?

【问题讨论】:

    标签: cruisecontrol.net nant


    【解决方案1】:

    将其包装在 NAnt task 或 MSBuild task 中,并将其作为构建的一部分执行。

    【讨论】:

    • 谢谢 - NAnt 链接非常有用,清楚地显示了如何添加构建任务。但是,它并没有告诉我如何以失败的单元测试的方式“破坏构建”,例如。我只是抛出一个异常吗?返回特定类型?
    • 约定是throw new BuildException('Reason of build failure');。 NAnt 负责其余的工作。
    • 太棒了。这正是我正在寻找的。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多