Currently declarative pipeline will do checkout scm
automatically when hitting first stage.
What I want is to checkout scm within subdirectory only. (so it won't checkout same thing in root directory)
Since it needs jenkinsfile it already checkout once. Plus directory & subdirectory I checkout thrice total... Is it possible to disable auto checkout in multibranch pipeline using declarative syntax?
The UI controls to disable and enable Multibranch / Organization items have been fixed in Folders Plugin 6.12 as per JENKINS-60900. Since Folders Plugin 6.12 , you'll be able to enable and disable them by clicking on the Disable Multibranch Pipeline or the corresponding item button.
There should be an option to create branch projects automatically wherever a Jenkinsfile is detected, yet suppress the automatic SCM trigger which fires when branch indexing detects a new branch head. Manual or other automatic scheduled builds should still be possible.
Enter the branch in "Exclude branch" and save the settings. If you don't have control of the project settings, the easy way is to rename the Jenkinsfile in the project/branch. This configuration will define to trigger a build if a branch/project has "Jenkinsfile" in it. Hence, renaming it will not trigger a build.
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.
Add options { skipDefaultCheckout() } if you use Declarative pipeline
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