我们可以告诉CruiseControl.NET忽略源代码控制超时错误吗? [英] Can we tell CruiseControl.NET to ignore source control timeout errors?
问题描述
我们有CruiseControl.NET设置,以便持续集成我们的一些项目。
We have CruiseControl.NET set up to do continuous integration of a number of our projects.
我们使用< cb: define>
块,以确保所有的源代码控制操作都以相同的方式完成,并保持配置DRY。
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 Files\CollabNet Subversion Server\csvn.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>
您需要将它们放在< project>
标记,而不是< sourcecontrol>
。我不知道你可以忽略只是超时异常,虽然 - 所有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:
maxSourceControlRetries :在项目进入停止之前可能发生的行中源控制异常的最大数量state(当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:在出现错误时运行发布商部分
- ReportOnEveryRetryAmount:在达到maxSourceControlRetries时运行发布商部分。ReportOnRetryAmount:只有在达到maxSourceControlRetries时才运行发布商部分。当达到maxSourceControlRetries并且发布商部分已运行时,计数器将设置为0.
这篇关于我们可以告诉CruiseControl.NET忽略源代码控制超时错误吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!