Jenkins: the best way to build a project with subprojects

We have a project with two subprojects in the same SVN repository. For instance:

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

The assembly for the project should include the results of building both subprojects. To make our assembly faster, I want to start building subproject1 only if the SVN has been changed accordingly (in svn: // ip / svn / trunk / subproject1). Similarly for subproject 2

What is the best way to do this? Can I do this with one job? How to define assembly triggers in this case?

Or do I need to define 3 tasks: one for each subproject or one for each project?

Any help would be appreciated! Regards Michael

+4
source share
4 answers

There are various ways to achieve this with Jenkins.

  • The multi-SCM plugin will allow - as the name suggests - to include several source repositories in one task.

  • You can define tasks n that initiate each other (i.e. are dependent on each other). You can find this under Build Triggers > Build after other projects are built .

  • There is also an option for the main job that controls the downlink. You will find this option under Post-build Actions > Build other projects .

As for the build trigger, you can use the poll SCM option. This is not the most efficient method , but your options may be limited by SVN, not Git.

I just noticed that you also mentioned matching results with all assemblies - you can achieve this either with a single task, or with the option aggregate downstream test results in the Post-build Actions section.

Ultimately, you need to clearly understand your build strategy. It seems to me that you want nothing to be violated if a change was made to any of the subprojects. I'm not sure how well the multi-SCM plugin handles the concept of polling multiple repositories, so you might need to consider this.

I think I gave you some options to try; let me know how you are doing.

+9
source

This is an old thread (18 months), but a few days ago the Jenkins multijob plugin released a new version, which includes an option that allows you to start building only when scm has changed since the last build:

This is an Assembly only if SCM changes .

There is also the option to force an assembly regardless of this option.

+2
source

There is also a Multijob Plugin available for Jenkins. You can use it to hierarchically build your projects in one main project.

+1
source

I don’t know how to install SVN, but with GIT you can install Additional actions at the source control stage.

Select Poll ignores commit in specific paths , then set Enabled Regions . This option can filter another subproject in one git repository.

Also configure in the Build Triggers step, check SCM Poll and leave Schedule empty.

If you want to set up automatic deployment, you may need to set the web hook on the git repository side.

Jenkins version - 2.32 and Jenkins git plugins

0
source

All Articles