Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jenkins how to enable checkout lightweight for pipelineJob?

Tags:

Here is my job DSL which creates pipelinejob in which script is taken from scm itself.

pipelineJob ("${jobName}_deploy") {
  description("built by seed")

definition {
     cpsScm {
        scm {
            git {
                remote {
                    url('gitUrl')
                    credentials('user_creds')
                }
              branch('master')
            }
        }
        scriptPath "scripts/pipeline/jenkinsfile_deploy"
    }
 }
 }

I need the lightweight checkout should be checked automatically. enter image description here

any help would be more appreciated. I have so many jobs in which i need to open each and every job and click that check box which is painful.

like image 323
ryan1506 Avatar asked May 01 '17 05:05

ryan1506


1 Answers

You can use a Configure Block to add any option that is missing in the built-in DSL:

pipelineJob('example') {
  definition {
    cpsScm {
      // ...
    } 
  }
  configure {
     it / definition / lightweight(true)
  }
}
like image 164
daspilker Avatar answered Sep 25 '22 10:09

daspilker