自动生成/删除jenkins作业 [英] Auto generate/remove jenkins jobs

查看:231
本文介绍了自动生成/删除jenkins作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法来自动创建一组jenkins作业(通常在创建新的(git)分支之后)。我已经试过这个Maven插件:



http://evgeny-goldin.com/wiki/Maven-jenkins-plugin



它工作的很好+它非常酷,管理所有jenkins作业从一个单一的pom.xml文件,名称,分支ID等可以被参数化(例如,通过属性)!

唯一的缺点是,我还没有想出如何再次删除工作,但它应该很容易扔在一个清理脚本。



是否有更好的方法来自动生成jenkins作业?例如。直接从构建脚本(pom.xml,build.gradle等)使用jenkins api。



我正在研究的其他方法:

http://entagen.github.com/jenkins- build-per-branch /



http://amokti.me/2011/10/11/automatic-opt-in-branch-building-with-jenkins-and -git-2 /

解决方案

另一种方法是引入 Gerrit 进入工作流程。提交审查的补丁集在Gerrit内实施为分支机构。有一个 Jenkins插件它可以自动构建和测试这些审查请求,这是一个非常方便的功能,我认为它可以满足您的需求。

Gerrit被几个大型开源项目所使用:


I am looking for a method to automatically create a set of jenkins jobs (typically after new (git) branches have been created). I have tried this plugin for maven:

http://evgeny-goldin.com/wiki/Maven-jenkins-plugin

and it works fine + its pretty cool to manage all jenkins jobs from a single pom.xml file where names, branch ids etc can be parameterized (eg. through properties)!

The only downside is that I have not figured out how to remove the jobs again but its should be easy to throw in a cleanup script.

Are there better approaches out there to auto-generate jenkins jobs? Eg. using the jenkins api directly from a build script (pom.xml, build.gradle, etc).

Other approaches I am looking into:

http://entagen.github.com/jenkins-build-per-branch/

http://amokti.me/2011/10/11/automatic-opt-in-branch-building-with-jenkins-and-git-2/

解决方案

An alternative approach is to introduce Gerrit into the workflow. Patchsets submitted for review are implemented within Gerrit as branches.There is a Jenkins plugin which can automatically build and test these review requests, a very handy feature, which I think would fulfil you needs.

Gerrit is used by several large open source projects:

这篇关于自动生成/删除jenkins作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆