Conditional Finish Build Trigger


I currently have a setup where I have BuildConfigA and BuildConfigB. Sometimes when BuildConfigA finishes I want to run a BuildConfigB build. However, I don't always want this. Currently I have a Finish Build Trigger set up on BuildConfigB and it always runs a build if BuildConfigA finishes. Is there a way to make this conditional, say on the value of a parameter or some other means?


Usage example:

The nightly build of BuildConfigA should trigger BuildConfigB to run

However, if I manually run BuildConfigA during the day, I don't want BuildConfigB to run




Comment actions Permalink


It is not currently possible to customize the finish build trigger exactly as you're describing. However, we do have a feature request that I think would be related. Please take a look at TW-36175. If this is what you're looking for, please vote to show your interest. We use the information on the YouTrack site to determine which features are included in future releases.

It might be possible to do something close to this by using the Triggered Build Customization feature to set a parameter to a specific value (i.e. %triggeredBySchedule% = true) when the build is triggered by a scheduled trigger. You can then add an initial Conditional Build Step to BuildConfigB to cancel/stop the build via service message if the BuildConfigA parameter is set. In this case, BuildConfigB will always get triggered but would cancel itself immediately if BuildConfigA.triggeredBySchedule != true.

Comment actions Permalink

Hi Eric,

Thanks for the reply and for pointing out the feature request and the potential workaround.

I believe the workaround will not work because I still want the ability to run BuildConfigB manually as well. With the suggested setup BuildConfigB will never run when I run one manually (as %triggeredBySchedule% will not be set to true).

We will make do without for now, and I have voted on the feature request.




Please sign in to leave a comment.