Michael
Michael

Reputation: 10329

Jenkins: conditional trigger on the build step

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

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

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

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

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

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

Any help will be appreciated!

Best regards, Michael

Upvotes: 0

Views: 2096

Answers (1)

parsifal
parsifal

Reputation: 529

Short answer: no.

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.

Upvotes: 2

Related Questions