shallow clone, sparse checkoutを使うことで、容量を軽くしてローカルに落とすことができる
Job DSLの場合
pipelineJob('myJob') {
definition {
cpsScm {
scm {
git {
configure { git ->
// sparse checkout
git / 'extensions' / 'hudson.plugins.git.extensions.impl.SparseCheckoutPaths' / 'sparseCheckoutPaths' {
'hudson.plugins.git.extensions.impl.SparseCheckoutPath' {
path('src')
}
}
// shallow clone
git / 'extensions' / 'hudson.plugins.git.extensions.impl.CloneOption' {
shallow(true)
depth(1)
noTags(true)
}
}
remote {
url('https://bare.example.com/repository.git')
credentials('credential')
}
branch('master')
}
}
lightweight(false)
scriptPath("Jenkinsfile")
}
}
}