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']]])