3
votes

If I delete and recreate a multibranch pipeline it seems like jenkins tries to build ALL branches because they are all "new" to it.

Is there a way to say "index but dont build" for the initial indexing operation? I will want to do this if I have to delete and recreate a job or if standing up a replacement master.

For example I use the job dsl to create multibranch jobs. Now I can have the seed job create all the multibranch pipeline jobs with "Suppress automatic SCM triggering", wait for the indexing to finish, then go back and manually remove the "Suppress automatic SCM triggering" from every job- but it would be better to just say "dont build for first indexing operation".

1

1 Answers

2
votes

The "Suppress automatic SCM triggering" branch source property strategy will make sure builds are not triggered on the associated branches when multibranch pipelines are scanned. However, this will unfortunately also disable webhooks from triggering builds. At least when testing this on Jenkins version 2.138.3 with Branch API plugin (id: branch-api) version 2.1.1 and Pipeline: Multibranch plugin (id: workflow-multibranch) version 2.20.

Related issue in the Jenkins issue tracker: https://issues.jenkins-ci.org/browse/JENKINS-32396