当您想在kubernetes中将jenkins实例配置为代码时,可以使用helm和JCasC
在编写jenkins管道时,可以在jenkins文件中完成
但是,当您想要在Jenkins中定义一个多分支管道时,您必须单击new item和multi pipeline,然后以图形方式执行所有这些步骤。
嗯,我有大约30个多分支管道,我真的很想将它们的设置也定义为代码。
这叫什么?有没有办法从jenkins中导出此配置,然后将其添加到JCasC?
发布于 2021-09-17 10:21:45
我猜您希望在本例中的JCasC中配置mulitbranchPipeline,以创建多分支管道
multibranchPipelineJob('Add your job name here'){
branchSources {
branchSource {
source {
git {
id = 'Add your job name here'
remote('Add you git repo.git')
credentialsId('')
traits {
gitBranchDiscovery()
gitTagDiscovery()
}
}
}
strategy {
defaultBranchPropertyStrategy {
props {
noTriggerBranchProperty()
}
}
}
}
}
displayName('Add your job name here')
orphanedItemStrategy { discardOldItems { numToKeep(-1) } }
}有关更多信息,请查看文档https://jenkinsci.github.io/job-dsl-plugin/#
https://stackoverflow.com/questions/69221659
复制相似问题