詹金斯:构建步骤的条件触发器 [英] Jenkins: conditional trigger on the build step

查看:149
本文介绍了詹金斯:构建步骤的条件触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在同一个SVN信息库中,我们有一个包含几个子项目的项目. 例如:

We have a project with couple of subprojects in the same SVN repository. For example:

svn://ip/svn/ trunk/subproject1
svn://ip/svn/ trunk/subproject2

Jenkins是否可以在构建步骤中创建条件触发器?

Is it possible in Jenkins to create conditional trigger on the build step?

我将澄清:仅当更改其SVN树时,我才想执行Maven构建步骤.

I will clarify: I want to execute the Maven build step only if its SVN tree was changed.

例如,svn://ip/svn/trunk/subproject1树已更改.在这种情况下,应触发整个构建.

For example, svn://ip/svn/ trunk/subproject1 tree was changed. In this case the whole build should be triggered.

然后,(由于svn://ip/svn/trunk/subproject1树已更改),将执行subproject1的Maven构建步骤.

Then, (since svn://ip/svn/ trunk/subproject1 tree was changed) the Maven build step for subproject1 will be executed.

但是由于svn://ip/svn/trunk/subproject2未被更改,因此不会执行subproject2的Maven构建步骤.

But the Maven build step for subproject2 will NOT be executed, since svn://ip/svn/ trunk/subproject2 was not changed.

任何帮助将不胜感激!

最诚挚的问候, 迈克尔

Best regards, Michael

推荐答案

简短答案:否.

长答案:是的,如果您为每个模块创建单独的Jenkins构建,则父项目不会尝试既是聚合器" POM(包含子模块列表)又是父" POM(包含孩子使用的定义).这还具有适当重建依赖项目的好处.

Long answer: yes, if you create separate Jenkins builds for each module, and the parent project does not attempt to be both an "aggregator" POM (containing a list of child modules) and a "parent" POM (containing definitions used by the children). This also has the benefit of properly rebuilding dependent projects.

也就是说,您为什么要担心与詹金斯一起重建一切?通常,这是最好的方法,因为它可以清除子项目之间的任何意外关系.

That said, why are you concerned about rebuilding everything with Jenkins? It's usually the best approach, as it flushes out any unexpected relationships between child projects.

这篇关于詹金斯:构建步骤的条件触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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