简体   繁体   English

CruiseControl.NET-如何在项目失败时触发构建

[英]CruiseControl.NET - how to trigger build upon project failure

I have some internal errors coming up from 3rd party libraries during the build of a complex solution in VS2010 and sometime also errors accessing time servers on the net. 在VS2010中构建复杂解决方案的过程中,第三方库出现了一些内部错误,有时还会在网络上访问时间服务器时出错。 I can detect these particular build errors by parsing the build log file. 我可以通过分析构建日志文件来检测这些特定的构建错误。

my normal trigger is: 我的正常触发条件是:

<intervalTrigger
               name="Build Upon Check-In Modifications"
               seconds="300"
               buildCondition="IfModificationExists"
               initialSeconds="300"/>

how do I add a trigger that triggers the build again if the project build failed due to above mentioned errors? 如果由于上述错误导致项目构建失败,如何添加触发器以再次触发构建? Normally repeating the build gets rid of the errors...(also, my parsing of build log file is in C# and is under my control) 通常,重复构建会消除错误...(而且,我对构建日志文件的解析是在C#中并且在我的控制下)

The only thing I can think of right away is having another project, pointing to the same sources, but triggered by the project trigger, which in its turn it tied to the first project. 我唯一能想到的就是拥有另一个项目,它们指向相同的源,但由项目触发器触发,而该触发器又与第一个项目相关。 The project trigger can be configured to start the build only in case of master build failure. 可以将项目触发器配置为仅在主构建失败的情况下才开始构建。

That's answer to the technical side, but semantically it looks quite weird to work it around this way. 这是对技术方面的回答,但是从语义上来说,以这种方式解决它似乎很奇怪。 The better way would be to spend some time and find out the exact problems and handle appropriately. 更好的方法是花一些时间来找出确切的问题并适当地处理。 For instance, if you depend on the web services, which are unavailable, you can create a loop of tries and have the number of attempts configurable, and so on. 例如,如果您依赖于不可用的Web服务,则可以创建尝试循环并可以配置尝试次数,依此类推。

Hope you get the idea. 希望你能明白。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM