0

I would like to use the multibranch pipeline functionality offered by Jenkins with some projects that have been around for long time, with a lot of branches.

I am using it in conjunction with the Basic Branch Build Strategies Plugin and the Multibranch Scan Webhook Trigger.

Since the projects have a lot of branches I would like to just index the branches when the multibranch pipeline is triggered and run the actual pipeline for a branch only when a new commit is pushed (The Multibranch Scan Webhook Trigger is used to notify the multibranch pipeline).

I have noticed the option "Skip initial build on first branch indexing" provided by the Branch Build Strategies Plugin which looked perfect at first: the branch is just indexed and the build is not triggered the first time.

The only issue is that the same goes for every new branch that gets created whereas I would like this option to be active only for the old branches.

The "Tags" option of the Branch Build Strategies Plugin has a "Ignore tags older than" parameter... a parameter like that for the "Skip initial build on first branch indexing" option would cover my use case but unfortunately there are no parameters available for it.

  • HI @giovanni-di-santo, so you want to trigger MB pipeline only against certain older branches? If so, can you check the Branch API plugin that goes well with the MB pipelines. Link to its Doc and usage are here - https://plugins.jenkins.io/branch-api/. This plugin would assist in the limiting the builds against a branch, regexing the branch names and other features. PS. I am not able to see any official doc for Basic Branch Build Strategies Jenkins Plugin though, most likely its old and moved elsewhere. – Param J Feb 24 '22 at 23:12
  • Hi @ParamJ, thanks a lot for your reply. I ended up developing a custom plugin as I could not find anything but I will take a look to the one you suggested. Thanks. – Giovanni Di Santo Mar 04 '22 at 11:07

0 Answers0