【问题标题】:Configuring Jenkins Multibranch Pipelines without the GUI在没有 GUI 的情况下配置 Jenkins 多分支管道
【发布时间】:2017-08-20 05:52:23
【问题描述】:

是否可以从终端配置 Jenkins 多分支管道以及相关的凭据、插件(对于 bitbucket 存储库需要插件)和节点?

我担心的是,自动配置 Jenkins 多分支管道可能必须每次都通过 GUI 手动执行上述任务。

【问题讨论】:

    标签: user-interface automation jenkins-pipeline multibranch-pipeline


    【解决方案1】:

    您可以使用dsl插件生成多分支管道作业

    这是一个例子

    multibranchPipelineJob('PIPELINE-test') {
            branchSources {
                git {
                    remote('git@github.com:xxx/repoName.git')
                    credentialsId('xxxxx-yyyyy-zzzzz')
                    excludes('master')
                }
            }
            description ("""<p> <b>generate by DSL - DO NOT CHANGE Manually </b> <p>""")
            triggers {
                periodic(2)
            }
            orphanedItemStrategy {
                discardOldItems {
                    numToKeep(0)
                    daysToKeep(0)
                }
            }
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 2020-01-02
      • 2014-04-05
      • 1970-01-01
      • 2017-11-29
      • 1970-01-01
      相关资源
      最近更新 更多