I have git monorepo repository with multiple projects inside. So I have following structure of Jenkinsfiles in this repo:
|-Jenkinsfile (root one)
|-projectA
| |-Jenkinsfile (for projectA)
| |- ... (project files)
|-projectB
|-Jenkinsfile (for projectB)
|- ... (project files)
In main root Jenkinsfile I have logic to check PR changed files and then trigger projects pipelines when files in specific project were changed.
And I have Webhook.
My problem is that all those 3 pipelines are triggered by Webhook. So my current state is:
So in runs I have:
And I want to have:
I cannot change webhook nature because it's monorepo so its sent every time anyone does anything in any project. So I need to prevent projectA and projectB pipelines from reacting on incoming webhook.
Does anyone know how to do it?
I found a solution:
multibranchPipelineJob(...) {
branchSources {
branchSource {
source {
...
}
strategy {
allBranchesSame {
props {
suppressAutomaticTriggering()
}
}
}
}
}
...
}
This setting prevents webhook triggers to start job.