简体   繁体   English

是否有一个Maven插件来创建Jenkins作业

[英]Is there a Maven plugin to create Jenkins job

I have about a hundred maven projects for which I would like to create Jenkins jobs. 我有大约一百个Maven项目,我想为其创建Jenkins职位。 Instead of creating the jobs by hand, with the likely attendant mistakes, is there a way to create from a maven plugin? 有没有一种方法可以通过Maven插件进行创建,而不是手动创建工作(可能会伴随一些错误)?

There is the job-dsl plugin which allows you to build jobs in a groovy DSL 有一个job-dsl插件 ,它允许您在Groovy DSL中构建作业。

This works by providing a build step in a separate job 通过在单独的工作中提供构建步骤来工作

You can loop through your jobs as explained here 您可以按照此处的说明循环工作

def giturl = 'https://github.com/quidryan/aws-sdk-test.git'
for(i in 0..10) {
    job("DSL-Tutorial-1-Test-${i}") {
        scm {
            git(giturl)
        }
        steps {
            maven("test -Dtest.suite=${i}")
        }
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM