Skip to content

Conversation

@francoisferrand
Copy link
Contributor

Add the lightweight property to cpsScm, to allow lightweight checkout
to retrieve the pipeline script.

Add the `lightweight` property to cpsScm, to allow lightweight checkout
to retrieve the pipeline script.
@dalbertom
Copy link

hey @daspilker I was wondering if this is needed as part of JENKINS-46463.

I tried the snippet mentioned in the ticket

pipelineJob(String name) {
  definition {
    cpsScmFlowDefinition {
      scm { ... }
      scriptPath(String value)
      lightweight(boolean value)
    }
  }
}

but since my definition already has a cpsScm block I'm not sure if I should have both or just cpsScmFlowDefinition. The scm block with git didn't seem to work in cpsScmFlowDefinition (I got a "ERROR: (controlCreate.groovy, line 1212) No signature of method: javaposse.jobdsl.plugin.structs.DescribableListContext.git() is applicable for argument types")

Should lightweight be documented in https://jenkinsci.github.io/job-dsl-plugin ?

Thanks!

@dalbertom
Copy link

I was able to get it to work via configure:

pipelineJob(jobname) {
  description(jobDescription)                                                                                
  definition {                                                                                               
    cpsScm {                                                                                                 
      scm {                                                                                                  
        git {                                                                                                
        ...
        }                                                                                                    
      }                                                                                                      
      scriptPath("$jenkinsfile")                                                                             
    }                                                                                                        
  }                                                                                                          
  configure { node ->                                                                                        
    node/definition << {                                                                                     
      lightweight(true)
    }                                                                                                        
  }                                                                                                          
}                                                                                                            

@jiff-infrastructure
Copy link

Can one of the admins verify this patch?

@daspilker daspilker merged commit e7960ac into jenkinsci:master Jan 28, 2018
@francoisferrand francoisferrand deleted the cpsScm-lightweight branch January 29, 2018 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants