gpt4 book ai didi

jenkins - multibranchPipelineJob 作业 DSL : how to enable Discover branches and Suppress automatic SCM triggering

转载 作者:行者123 更新时间:2023-12-01 21:56:58 26 4
gpt4 key购买 nike

如何在 Jenkins 作业 DSL 中为多分支管道启用行为 Discover Benches 和属性策略 Suppress automatic SCM triggering

enter image description here

最佳答案

可以这样做:

multibranchPipelineJob('job name') {
branchSources {
branchSource {
source {
git {
remote('https://<repo address>.git')
credentialsId('credential id')
}
}
strategy {
defaultBranchPropertyStrategy {
props {
noTriggerBranchProperty()
}
}
}
}
}
configure {
def traits = it / sources / data / 'jenkins.branch.BranchSource' / source / traits
traits << 'jenkins.plugins.git.traits.BranchDiscoveryTrait' {}
}
triggers {
periodic(2) // Trigger every 2 min.
}
orphanedItemStrategy { discardOldItems { numToKeep(-1) } }
}

关于jenkins - multibranchPipelineJob 作业 DSL : how to enable Discover branches and Suppress automatic SCM triggering,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56291978/

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