I cannot find a way to edit the configuration of multibranch pipeline projects. When I change to the branch level, there is only a "view configuration" menu item, as opposed to ordinary pipeline projects.
I am looking for a method to configure build triggers from outside Jenkins. My current workaround (define a pipeline per branch) is not feasible beyond initial testing.
Step 1: From the Jenkins home page create a “new item”. Step 2: Select the “Multibranch pipeline” from the option and click ok. Step 3: Click “Add a Source” and select Github. Step 4: Under the credentials field, select Jenkins, and create a credential with your Github username and password.
Multibranch Pipelines can be used for validating pull/change requests with the appropriate plugin. This functionality is provided by the following plugins: GitHub Branch Source. Bitbucket Branch Source.
If you want to add new parameters you have to do it using properties in Jenkinsfile - goto <JENKINS URL>/pipeline-syntax and generate code for the properties step.
You can edit the overall configuration of a multi-branch pipeline project, such as the repo it will read from and any credentials it will need, triggers for scanning the branch to check for changes (Note: not the same as build triggers),orphaned item strategy, build configuration, properties, and a few other things. This can be viewed by clicking "Configuration" on the page that shows all the branches, or it will say it is empty if there are none.
Please note this only applies to multibranch pipelines that are not part of an organizational folder (not a "Bitbucket Team/Project" or "GitHub Organization" type project.)
If you click a branch name (ex: master), clicking "View Configuration" will only let you view it. You have to edit the file defining that pipeline on the correct branch in order to change it. In the case of these screen shots, you need to edit the Jenkinsfile
in the Test-Multibranch-Job
repo on the master
branch to edit the configuration.
To add a trigger mechanism, you could add triggers { gitlab(<config-here>) }
to your Jenkinsfile
if your repo is in Gitlab. Also note whether you are using a declarative pipeline or a scripted pipeline because the syntaxes are different.
NOTE: I am running Jenkins ver. 2.92
https://issues.jenkins-ci.org/browse/JENKINS-33900
"As designed, these jobs are view-only." -- Jesse Glick
you should be able to define the config in the pipeline itself, e.g. https://jenkins.io/doc/book/pipeline/syntax/#triggers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With