gpt4 book ai didi

jenkins - 如何在提交到分支时触发多分支管道构建?

转载 作者:行者123 更新时间:2023-12-04 15:57:03 25 4
gpt4 key购买 nike

在多分支管道作业中,我配置了构建(基本 linting)以跨分支扫描 jenkins 文件。但是,我仍然必须手动执行此构建。我可以设置什么属性来启用对 GitHub 的轮询,或者更好的是在新提交时触发。

一般来说,我试图找到一种方法来了解所有 GUI 字段如何映射到我可以在 properties(); 中使用的键。方法。我无法在 GUI 表单字段和脚本键值选项之间进行转换。

node('master') {
properties([
[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10']],
[$class: 'BuildTriggerProperty???', strategy: 'Build when a change is pushed to GitHub???']
]);

...
}

Jenkins 版本 2.7

最佳答案

I'm trying to find a way to learn how all GUI fields map to keys I can use in the properties(); method.



如果我猜对了,答案是:
  • 转到您的管道项目页面
  • 查找 管道语法 左侧菜单中的链接并按照它
  • 查找 片段生成器 左侧菜单中的链接并按照它
  • 选择 属性:设置作业属性 来自 示例步骤 下拉
  • 选择您想要的任何内容,然后单击 生成 Groovy
  • 利润 =)
  • 关于jenkins - 如何在提交到分支时触发多分支管道构建?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39544445/

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