I have the following scenario: Build A is building multiple branches (CI build for github repository), and I want it to trigger Build B, but only if the branch == "master".
I found that I can enable downstream triggers under "Post Build Actions" > "Trigger parameterized build on other projects". I picked the downstream project and to only build when stable. So far, so good.
Then, I found that I can do "Restrict matrix execution to a subset" and I put this in:
"${BRANCH}"=="master"
However, it still builds the downstream project B regardless of whether the branch is master, or something completely different (it then btw. builds the downstream project with the same branch as project A).
Am I misunderstanding something here? Isn't this the way to filter the downstream execution?
If it's not at all, is there any other way to only build the downstream project when the branch is "master"?
Here's the parameterized trigger plugin btw.
Actually found a solution that seems to work just fine based on the discussion in this pull request
The solution is to use the flexible publish plugin and come up with the conditions for the build. Then, under actions, pick the parameterized trigger plugin to kick off the other build.
For the conditions you can use the "current build status" to only trigger on successful builds, and then I used string matcher to make sure the branch equals "master". I think the boolean condition option would have worked too.
According to the thread, whatever I wanted to do directly in the parameterized trigger plugin with the execution matrix restrictions won't work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With