CruiseControl.NET - how to trigger build upon project failure

199 Views Asked by At

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. 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)

1

There are 1 best solutions below

0
On

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.

Hope you get the idea.