Marc Guillemot
unread,Dec 13, 2021, 8:37:15 AM12/13/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jenkins...@googlegroups.com
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