1

Is it possible to configure Jenkins Multibranch Pipelines - as well as the associated credentials, plugins (for bitbucket repos a plugin is required), and nodes - from the terminal?

My concern is that, at best, automating the configuration of a Jenkins Multibranch Pipeline may have to include manually performing the above tasks via the GUI every time.

4

1 回答 1

3

您可以使用 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)
            }
        }
    }
于 2017-08-21T17:22:00.747 回答