Reputation: 1081
How can a job A trigger a job B, such that job B will poll its SCM and then decides wether the actual build would be started or not?
Here is my 'real world' setup: I have a job called GIT_PULL which is using Jenkins DSL to create child jobs depending on sub folders in the repository content. Those child jobs poll the SCM itself but with the option 'Polling ignores commits in certain paths' to ensure they were just triggered, when their sub path has changed.
The current state is that all the child jobs poll the SCM theirselves every H/5 minutes and run independently of their parent job GIT_PULL. However I need to know in GIT_PULL if after a SCM change all child jobs has run fine. But when I switch the polling in the child jobs off and trigger all child jobs in GIT_PULL, they will all run no matter if their repository sub paths has changed or not.
So how can I trigger all child jobs in GIT_PULL, waiting for their result and such that the child jobs will check SCM changes before they will actually run?
Upvotes: 1
Views: 553
Reputation: 1081
Yess - The Multijob Plugin will do the trick.
Within a MultiJob you can define downstream jobs to start but to Build only if SCM changes (that is the exact option name) occur in the downstream project.
Upvotes: 1