Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jenkins multibranch pipeline disable auto node checkout

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?

like image 742
Yen Avatar asked Dec 01 '17 01:12

Yen


People also ask

How do I disable Jenkins Multibranch pipeline?

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.

What is suppress automatic SCM triggering?

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.

How do I disable some branches in Multibranch Jenkins builds?

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.

What is the difference between pipeline and Multibranch pipeline?

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.


1 Answers

Add options { skipDefaultCheckout() } if you use Declarative pipeline

like image 99
Shampoo Avatar answered Oct 06 '22 07:10

Shampoo