Hi,

we have a quite heavy git repository therefore we configure sparse
checkout for the associated multibranch pipeline job running builds in
containers. The complete checkout is required in the containers (scm
with original configuration from the job except the sparse
configuration). We achieve this currently with a step in a custom
pipeline library:

// ---- Jenkinsfile ---
...
podTemplate(cloud: 'kubernetes-svr-rancher....', yaml: podYaml) {
  node(POD_LABEL) {
    checkout customScmWithoutSparseConfig()
    ...
  }
}

// ---- pipeline step customScmWithoutSparseConfig ---
def call() {
  // weird: working directly on variable scm doesn't work, checkout is
then still performed with sparse config
  def modifiedScm = scm

modifiedScm.extensions.remove(hudson.plugins.git.extensions.impl.SparseCheckoutPaths)
  return modifiedScm
}


This solution is working for us but it rather looks like a hack than
like a clean way.

Is there a better, cleaner way to perform a checkout without the sparse
settings configured in the multibranch pipeline job?

Cheers
Marc

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/bd48f63d-7f48-70ad-f07f-429eba1b3534%40yahoo.fr.

Reply via email to