Please help with a real working example with "checkout sparse".

My code that doesn't work correctly. I expect when running this code that only 
the "/src/jenkins" folder from my SCM will be cloned locally, but this still 
clones the entire repository (4GB).
I only need the /src/jenkins folder from my github-repository to execute 
pipeline.

My checkout code:

checkout ([
    $class: 'GitSCM',
    branches: [[name: '"*/"${params.branch_name}']],
    doGenerateSubmoduleConfigurations: 'false',
    extensions: [[$class: 'SparseCheckoutPaths', path: '/src/jenkins'],[$class: 
'CheckoutOption', timeout: 180],[$class: 'CloneOption', depth: 0, noTags: true, 
reference: '', shallow: false, timeout: 60]],
    submoduleCfg: [],
    userRemoteConfigs: [[url: 'https://github.com/myrepo.git', credentialsId: 
'github-pat']]])

-- 
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/929505518.20201112151626%40gmail.com.

Reply via email to