Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Multibranch Pipeline Lightweight Checkout

The Jenkins Pipeline plugin has a feature known as "lightweight checkout", where the master only pulls the Jenkinsfile from the repo, as opposed to the entire repo. There's a corresponding checkbox in the configuration screen. I'd like to do a lightweight checkout in a multibranch pipeline, but I'm not seeing a checkbox in the multibranch configuration screen. Any ideas how to make this happen? I noticed some closed issues that suggest this feature is available, but I wasn't able to find any specifics on how to make it happen.

Related information:

https://issues.jenkins-ci.org/browse/JENKINS-42518

https://issues.jenkins-ci.org/browse/JENKINS-33273

https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/78

like image 711
ptsw Avatar asked Apr 18 '19 14:04

ptsw


People also ask

What is the difference between pipeline and Multibranch pipeline in Jenkins?

Jenkins Pipeline Vs. Multibranch Pipeline. A multibranch pipeline is meant for building multiple branches from a repository and deploy to multiple environments if required. A pipeline job supports both pipeline steps to be added in Jenkins configuration and form SCM.

How does Jenkins use Multibranch pipeline?

Head over to your Jenkins instance and create a new item. Enter a name for the job, and select the “Multibranch Pipeline” option at the end of the screen. Then, click on the OK button. In the next screen, go to the “Branch sources” tab, click on the “Add source” button, and choose “Git” from the dropdown menu.


1 Answers

I asked the developer, Vivek Pandey, who added the lightweight checkout feature to the multibranch plugin and he said that's the default behavior for the multibranch pipeline. Here's his response.

For multi-branch pipeline project GitHub or Bitbucket light weight checkout is default behavior. With bitbucket it wasn’t and that’s what my PR fixed. So basically you don’t need to do any configuration, it should work out of the box.

like image 178
ptsw Avatar answered Sep 20 '22 12:09

ptsw