有没有人有正确的代码示例
configure { ... }
Jenkins DSL插件中需要设置块来设置git稀疏签出吗?
好像config.xml部分看起来像这样:
<extensions> <hudson.plugins.git.extensions.impl.CloneOption> <shallow>false</shallow> <reference>/build/jenkins/codebase.git</reference> </hudson.plugins.git.extensions.impl.CloneOption> <hudson.plugins.git.extensions.impl.SparseCheckoutPaths> <sparseCheckoutPaths> <hudson.plugins.git.extensions.impl.SparseCheckoutPath> <path>BillOfMaterials.yml</path> </hudson.plugins.git.extensions.impl.SparseCheckoutPath> <hudson.plugins.git.extensions.impl.SparseCheckoutPath> <path>jenkins/job/</path> </hudson.plugins.git.extensions.impl.SparseCheckoutPath> </sparseCheckoutPaths> </hudson.plugins.git.extensions.impl.SparseCheckoutPaths> </extensions>
job('job1') { description 'sparse checkout example' scm { git { reference('/build/jenkins/codebase.git') configure { git -> git / 'extensions' / 'hudson.plugins.git.extensions.impl.SparseCheckoutPaths' / 'sparseCheckoutPaths' { ['mypath1', 'mypath2', 'mypath3'].each { mypath -> 'hudson.plugins.git.extensions.impl.SparseCheckoutPath' { path("${mypath}") } } } } } } }