Multiple multibranch pipeline builds from a single repo

359 views
Skip to first unread message

mark.g...@urbanise.com

unread,
Apr 13, 2016, 12:25:51 AM4/13/16
to Jenkins Users
We are about to switch our CI builds to jenkins and I would like to make use of the multibranch builds but we have multiple projects in a single repo which (as far as I can tell) won't work with the multibranch stuff as we would need a Jenkinsfile per project, not one for the whole repo. 

Our repo looks something like:

/
  /libraryProject
    build.xml
  /projectA
    build.xml
  /projectB
    build.gradle

where libraryProject builds a library jar that is published externally (to a nexus repo). The projectA/B builds retrieve the artifact from that repo when they build - so in that sense they are independent builds.

Ideally, what I'd like is to be able to do is have a Jenkinsfile in each of the 3 projects, and have a multibranch build for each of them. This would mean explicitly specifying the location of the Jenkinsfile per build (similar to how the current pipeline build works). The other thing that would be required is to only trigger the relevant build when repo changes (ie: if code under the projectA directory changed - only trigger the projectA multibranch build).

I don't think the above is possible at the moment (please let me know if I'm wrong), but can anyone suggest a way to achieve the same result (multiple multibranch pipeline builds from a single repo) with existing plugins? Or is what I'm trying to do not possible at the moment?

Thanks

Sorin Ionuț Sbârnea

unread,
Jul 12, 2017, 5:54:09 AM7/12/17
to Jenkins Users
I am still looking for this because the use of JJB is a productivity killer but I didn't find an answer yet.

I did asked the same question at https://stackoverflow.com/questions/45054290/how-to-manage-multiple-jenkins-pipelines-from-a-single-repository hoping that this will allow us to find a better solution and to avoid getting the subject lost in a mailing list.

Daniel Butler

unread,
Jul 12, 2017, 8:38:51 AM7/12/17
to jenkins...@googlegroups.com

The multibranch plugin from version 2.15 does support custom names for the pipeline script so you can now have multiple multibranch projects on the same repo.

 

As for only building on changes applicable to the respective folders I’m not able to answer that. If each of these projects are changing independently however then afaik the accepted practice is to have each in their own repo.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2dc43d51-fc1c-4cd2-809a-ceae7e25e98f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

Reply all
Reply to author
Forward
0 new messages