詹金斯:用子项目构建项目的最佳方法 [英] Jenkins: best way to build a project with sub projects
问题描述
我们在同一个SVN信息库中有一个包含两个子项目的项目. 例如:
We have a project with two subprojects in the same SVN repository. For example:
svn://ip/svn/ trunk/subproject1
svn://ip/svn/ trunk/subproject2
项目的构建应包括两个子项目的构建结果. 为了使构建速度更快,我仅在分别更改了SVN的情况下(在svn://ip/svn/trunk/subproject1中)才运行subproject1的构建.对于subproject2同样如此
The build for project should include results of builds of both subprojects. To make our build faster, I want to run build of subproject1 only if SVN was changed respectively (in the svn://ip/svn/ trunk/subproject1). Similarly for subproject2
最好的方法是什么? 我可以做一份工作吗? 在这种情况下,我应该如何定义构建触发器?
What is the best way to do it? Can I do it with a single job? How should I define build triggers in this case?
还是我需要定义3个工作:每个子项目一个或每个项目一个?
Or I need to define 3 jobs: one for each subproject or one for each project?
任何帮助将不胜感激! 最好的祝福, 迈克尔
Any help will be appreciated! Best regards, Michael
推荐答案
使用Jenkins可以通过多种方式实现.
There are various ways you can achieve this using Jenkins.
-
多SCM插件将允许-顾名思义-在一个作业中包含多个源存储库.
The multi-SCM plugin will allow - as the name suggests - to include multiple source repositories in a single job.
您可以定义相互触发的n
作业(即彼此依赖).您可以在Build Triggers
> Build after other projects are built
下找到它.
You can define n
jobs which trigger each other (i.e. have a dependency on each other). You can find this under Build Triggers
> Build after other projects are built
.
还可以选择由主作业控制下游作业.您可以在Post-build Actions
> Build other projects
下找到此选项.
There is also the option of a master job controlling the downstream jobs. You'll find this option under Post-build Actions
> Build other projects
.
关于构建触发,可以使用poll SCM
选项. 不是最,但您的选择可能会受到SVN而不是Git的限制.
With regard to build triggering, you can use the poll SCM
option. It's not the most efficient method but your options may be limited with SVN rather than Git.
我刚刚注意到您还提到了整理所有内部版本的结果-您可以通过完成一项工作或使用Post-build Actions
下的选项aggregate downstream test results
来实现此目的.
I just noticed you also mentioned collating results from all builds - you can achieve this either by having a single job or by using the option aggregate downstream test results
under Post-build Actions
.
最终,您需要清楚自己的构建策略.在我看来,如果要对任何一个子项目进行更改,您都希望确保没有任何损坏.我不确定multi-SCM插件如何处理轮询多个存储库的概念,因此您可能需要考虑这一点.
Ultimately, you need to be clear on your build strategy. It sounds to me that you want to ensure that nothing is broken if a change has been made to either sub-project. I'm not sure how well the multi-SCM plugin copes with the concept of polling multiple repositories so you may need to factor that in.
我认为我给了您一些选择来进行尝试;让我知道你过得怎么样.
I think I've given you a few options to try out; let me know how you get on.
这篇关于詹金斯:用子项目构建项目的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!