Multibranch pipelines are really only suitable for single-project
multi-branch repos. The farest I got with a multi-project setup was using
the Jenkins Repo Plugin (for the Google Repo Tool), but this would reverse
the use case you're looking for: It pings all subprojects / subrepos and
kicks off a build if any of those changed; you'd then still have to figure
out manually what exactly would need to be build once your build has been
kicked off.
I however suspect you could achieve this by remembering the last revision a
specific subtree / repo was changed yourself (git log -1 path/to/subtree).
Am Montag, 14. November 2016 12:18:06 UTC+1 schrieb Sverre Moe:
>
> I need some help brainstorming a solution for multiproject repositories.
> Pipeline building a repository that contains several delivery projects.
>
> The root of the repository contains several delivery projects.
> - delivery-project
> - delivery1
> - CMakeList.txt
> - delivery-project-delivery1.spec
> - src
> - delivery2
> - CMakeList.txt
> - delivery-project-delivery2.spec
> - delivery3
> - CMakeList.txt
> - delivery-project-delivery3.spec
> - src
>
> I could keep one Jenkinsfile on the root. Then iterate through all
> directories and build each delivery.
> However when there is an SCM change in only one of the deliveries I only
> want that one to be built.
> This could be solved if I could determine which directory has been
> changed. Something like this (ignore closure which doesn't work in
> Pipeline):
> changedDirectories.each { directory ->
> dir(directory) {
> doBuild()
> }
> }
> Though I'm not sure how to get the SCM changes to determine this.
>
> Considering this delivery git repository will only have a master branch, a
> Multibranch Pipeline project is not necessary, and a standard Pipeline job
> would suffice.
>
> I could also create a Folder job for delivery-project, and one Pipeline
> job for each delivery. Each subproject could contain its own Jenkinsfile
> which would be specified in the configuration in Script Path as
> delivery1/Jenkinsfile. However when a new delivery project is added to the
> repository it would require me to manually add a new Pipeline job for it.
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/d5abe033-2f3b-4b79-a55c-d97f59e78260%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.