创建SVN分支后,如何让Jenkins自动克隆Maven作业? [英] How to have Jenkins automatically clone a maven job when a SVN branch is created?
问题描述
我们的项目使用maven进行构建,将Subversion用作代码存储库,并使用Jenkins进行持续集成.创建新分支(通常是在发布期间)时,我们必须在Jenkins中手动创建一个新作业.
Our project uses maven to build, Subversion as code repository, and Jenkins for continuous integration. When a new branch is created (typically during a release), we have to create a new job in Jenkins by hand.
是否可以告诉Jenkins为新创建的分支(而不是旧分支)自动创建工作?
Is it possible to tell Jenkins to automatically create job for newly created branches (and not legacy ones) ?
推荐答案
是的,它是可行的.您将必须创建一个SVN挂钩,然后使用Jenkins CLI(可以使用groovy)或Jenkins REST API,您必须为该项目创建作业.
Yes, it is doable. You would have to create a SVN hook, and then using Jenkins CLI (you could use groovy) or Jenkins REST API you could have to create the job for the project.
以下是使用 Sinatra + GitHub 的示例 另一个使用 Groovy + GitHub
Here's an example using Sinatra + GitHub Another using Groovy + GitHub
这篇关于创建SVN分支后,如何让Jenkins自动克隆Maven作业?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!