How can I trigger a parameterized build only if the parent finished successfully AND it had changes (changes pushed to scm)?
Here is a scenario: I have 3 builds: A, B and C. B will built if it is called by A or it has changes. C should be built only if B finished successfully and if B was built because of scm changes and NOT because it was triggered by A
Thanks
Post-build Actions → Trigger parameterized build on other projects:
B
A_HAS_BEEN_BUILT=YES
Meta Data → [✔] This build is parameterized → Add parameter → String parameter:
A_HAS_BEEN_BUILT
NO
Post-build Actions → Trigger parameterized build on other projects:
C
A_HAS_BEEN_BUILT=${A_HAS_BEEN_BUILT}
Meta Data → [✔] This build is parameterized_ → Add parameter → String parameter:
A_HAS_BEEN_BUILT
NO
Build → Add Build step → Conditional step (single):
^YES$
${ENV,var="A_HAS_BEEN_BUILT"}
See Parameterized Build, Parameterized Trigger Plugin and Run Condition Plugin.
The settings given above induce the following:
According to the discussion the following is intended:
To prevent C from being triggered at 1.:
Create an upstream project to B that polls the SCM and triggers B
Configure the following in B:
Source Code Management → ◉ None
Build Triggers
Build → Add Build step → Conditional step (single):
C
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