This repository was archived by the owner on Jan 25, 2022. It is now read-only.
add support for triggering multibranch pipeline projects #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds support for triggering multibranch pipeline jobs, in particular for global hooks. This relies on the scan functionality of the multibranch jobs, once it detects the SCM Uri.
Currently in
def matches?(details, branch = false, exactly = false)I always return true, for a multibranch job since the uri has already been found. I know it would pass thematches_branch?but I don't see the point of traversing all the branches. In theory I think I should makesetup_scmsonly grab the first branch it finds as well since that's all we need to get a SCM repo Uri.This request only covers branches and not merge request. I'm looking into that next, but this seem self contained enough and worth adding to the main project. Also maybe you noticed something I missed as I continue down this path.
General note, these multibranch jobs extend from
hudson.model.AbstractItem->com.cloudbees.hudson.plugins.folder.AbstractFolderso that's why I made some decisions that I did since I couldn't useAbstractProject. I also decided to be more specific for the same reason's as I don't know how allAbstractFolderbehave.