R – How to Coordinate multiple builds in CruiseControl.Net

cruisecontrol.net

I have a scenario where in I need to define multiple msbuild tasks. I added a projectTrigger but the problem is that you need to specify the triggerStatus to success or failure. I need the build to be happen irrespective of whether the preceeding build succeeds or fails. What is the best solution for this?

Best Answer

I can think of two options. As Pedro mentioned, you can setup multiple triggers - one for Success of ProjectA and one for Failure. So, under your ProjectB:

<multiTrigger operator="Or">
    <triggers>
        <projectTrigger project="ProjectA">
            <triggerStatus>Success</triggerStatus>
        </projectTrigger>
    </triggers>
    <triggers>
        <projectTrigger project="ProjectA">
            <triggerStatus>Failure</triggerStatus>
        </projectTrigger>
    </triggers>
</multiTrigger>

The other way you can do it is from the other direction: use the Force Build Publisher. Instead of setting up a trigger in ProjectB, you can have ProjectA force the build:

<publishers>
    <!-- other publishers... -->
    <forcebuild>
        <project>ProjectB</project>
        <integrationStatus>Success</integrationStatus>
    </forcebuild>
    <forcebuild>
        <project>ProjectB</project>
        <integrationStatus>Failure</integrationStatus>
    </forcebuild>
</publishers>

It is slightly wonky that you have to define two cases (for Success and Failure). I haven't researched if there's a better way.

Related Topic