Issue
As for as I understood the Lightweight Checkout
is enabled by default on Jenkins. Does someone know how to disable it?
How found the pieces of information below"
About Multibranch Pipeline support
Multibranch Pipelines support lightweight checkout since JENKINS-33273.
It is activated by default.
There is a kill switch to deactivate it.
Simply add org.jenkinsci.plugins.workflow.multibranch.USE_HEAVYWEIGHT_CHECKOUT=true to Jenkins arguments
But I don't know how to add to Jenkins.
Solution
Cloudbees addressed JENKINS-33273 - Optimize Jenkinsfile loading and branch detection, which introduced/changed the behaviour.
Their blog has a post, Why is my multibranch project cloning the whole repository on the master? and a link for How to add Java arguments to Jenkins?.
See also Jenkins Features Controlled with System Properties. Essentially, it's a parameter in the arguments to launch Jenkins itself. Make sure it's a JENKINS_ARGS
and not JAVA_OPTIONS
.
JENKINS-45686 is Open to provide a UI option to manage this configurationy other means.
Additional pipeline info: Pipeline-as-code with Multibranch Workflows in Jenkins
Answered By - Ian W