I have three separate Multibranch pipeline jobs set up on Jenkins, which I want to be called sequentially as downstream-jobs. Please note that, all these 3 jobs have separate git repositories!
Each job has its own Jenkinsfile.
The first job is always triggered manually by me through the Jenkins UI. At the last stage of the 1st job's Jenkinsfile, the second job is being triggered, as shown below. (The second job triggers the third job, in the same way)
stage('Trigger second job')
{
steps {
build job: 'second_job_name', propagate: true, wait: false
}
}
Now this step always seems to be executed successfully when the first job ends, no errors or warnings show up on the logs. This should mean that the second downstream job has been called, but unfortunately that's not always the case:
- Sometimes the first job triggers the second job, but the second job never actually triggers the third one, although it seems to pass the corresponding Jenkinsfile stage.
- Sometimes the first job completes but never triggers the second job at all.
The only time this setup works as expected, is when there are new commits to all 3 git repos. Then all 3 jobs are triggered sequentially without issues.
Does anyone know the reason behind this inconsistent behavior? Is it maybe because the jobs are based on different git repos? Is there anything I can do to fix this?
Thanks