gpt4 book ai didi

jenkins - 使用 Jenkins DSL 插件进行稀疏结账?

转载 作者:行者123 更新时间:2023-12-03 03:19:22 26 4
gpt4 key购买 nike

有没有人有正确的代码示例

configure { ... }

Jenkins DSL 插件中需要 block 来设置 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}")
}
}
}
}
}
}
}

关于jenkins - 使用 Jenkins DSL 插件进行稀疏结账?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25943651/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com