我们可以告诉 CruiseControl.NET 忽略源代码控制超时错误吗? [英] Can we tell CruiseControl.NET to ignore source control timeout errors?

查看:28
本文介绍了我们可以告诉 CruiseControl.NET 忽略源代码控制超时错误吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们设置了 CruiseControl.NET 来持续集成我们的多个项目.

We have CruiseControl.NET set up to do continuous integration of a number of our projects.

我们使用 <cb:define> 块来确保我们所有的源代码控制操作都以相同的方式完成,并保持配置干燥.

We are using a <cb:define> block to make sure all of our source control operations are done in the same way, and to keep the config DRY.

我们每隔一段时间就会遇到一个问题,导致构建显示异常".消息如下:

We are experiencing an issue every once in a while that cause the build to show "Exception". The message is as follows:

ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation has timed out. 
    at ThoughtWorks.CruiseControl.Core.Sourcecontrol.ProcessSourceControl.Execute(ProcessInfo processInfo) 
    at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Svn.GetModifications(IIntegrationResult from, IIntegrationResult to) 
    at ThoughtWorks.CruiseControl.Core.Sourcecontrol.QuietPeriod.GetModifications(ISourceControl sourceControl, IIntegrationResult lastBuild, IIntegrationResult thisBuild) 
    at ThoughtWorks.CruiseControl.Core.IntegrationRunner.GetModifications(IIntegrationResult from, IIntegrationResult to) 
    at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest request)

常用配置部分如下:

<sourcecontrol type="svn">
    <trunkUrl>http://ourserver/svn/$(project-svn-path)/trunk/</trunkUrl>
    <executable>C:Program FilesCollabNet Subversion Servercsvn.exe</executable>
    <username>user</username>
    <password>password<password>
    <revert>true</revert>
</sourcecontrol>

如果可能,我想忽略这个特定的错误.

I would like to ignore this specific error, if possible.

我需要做哪些改变?

推荐答案

这是我用来防止这些类型的错误影响构建状态的块:

Here's a block I use to prevent these kinds of errors affecting the build status:

<maxSourceControlRetries>5</maxSourceControlRetries>
<stopProjectOnReachingMaxSourceControlRetries>true</stopProjectOnReachingMaxSourceControlRetries>
<sourceControlErrorHandling>ReportOnRetryAmount</sourceControlErrorHandling>

您需要将这些放在 标签的正下方,而不是 .不过,我不确定您是否能够仅忽略超时"异常 - 所有 SVN 异常都将被同等对待.

You need to put these right below the <project> tag, not the <sourcecontrol>. I'm not sure you'll be able to ignore just the "timed out" exception, though - all SVN exceptions will be treated the same.

更新:您可以在 CC.NET 文档中找到有关这些设置的更多信息,但让我复制相关内容:

UPDATE: you can find out more about these settings in the CC.NET documentation, but let me copy the relevant stuff:

ma​​xSourceControlRetries:在项目进入停止状态之前(当 stopProjectOnReachingMaxSourceControlRetries 设置为 true 时),一行中可能发生的最大源代码控制异常数量.

maxSourceControlRetries: The maximum amount of source control exceptions in a row that may occur, before the project goes to the stopped state(when stopProjectOnReachingMaxSourceControlRetries is set to true).

stopProjectOnReachingMaxSourceControlRetries:在是否达到 maxSourceControlRetries 时停止项目.当设置为 true 时,当连续的源代码控制错误数量等于 maxSourceControlRetries 时,项目将停止.

stopProjectOnReachingMaxSourceControlRetries: Stops the project on reaching maxSourceControlRetries or not. When set to true, the project will be stopped when the amount of consecutive source control errors is equal to maxSourceControlRetries.

sourceControlErrorHandling:发生源代码管理错误时(在 GetModifications 期间)要采取的操作.这些是可能的值:

sourceControlErrorHandling: What action to take when a source control error occurs (during GetModifications). These are the possible values :

  • ReportEveryFailure :每当出现错误时运行发布者部分
  • ReportOnRetryAmount :仅在达到 maxSourceControlRetries 时运行发布者部分,发布者部分将只运行一次.
  • ReportOnEveryRetryAmount :每当达到 maxSourceControlRetries 时运行发布者部分.当达到 maxSourceControlRetries 且发布者部分已运行时,计数器将重新设置为 0.

这篇关于我们可以告诉 CruiseControl.NET 忽略源代码控制超时错误吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆