Frage

I have a Gradle multiproject hosted in Mercurial repo. I would like to setup my Jenkins in such a way, that if I commit changes into only 1 subproject, then only that subproject will be built and published to my Nexus repo.

Can somebody give me a hint? Or is it at all possible?

War es hilfreich?

Lösung 2

Leaving our final solution for the future here.

We created a separate Jenkins job for each subproject. Jenkins' Mercurial plugin allows to specify "modules":

Reduce unnecessary builds by specifying a comma or space delimited list of "modules" within the repository. A module is a directory name within the repository that this project lives in. If this field is set, changes outside the specified modules will not trigger a build (even though the whole repository is checked out anyway due to the Mercurial limitation.)

This way our jobs are triggered only when change occurred in the monitoring sub-project.

Andere Tipps

We sort of have this working.

We create a project in Jenkins for each gradle subproject. And in the Jenkins configuration we build only the subproject by doing something like:

gradle clean :<subproject>:build

We still have the problem that the job is fired for all checkins to the entire project. I would to configure Jenkins to build only when there's checkin to the subproject, but don't know how to specify this.

I guess you need to create a project in jenkins for each subproject.

Other option would be to find if there is a way to intercept the repo sync and see what subproject has changed and do the build dynamically.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top