jenkinsjenkins-pipelinejenkins-blueocean

building two repositories in one jenkins pipeline


I try to wrap my head around the problem, so it is also hard for me to ask any specific questions.

I have repo R1 and repo R2 at github. but I need to build them as one as this is a legacy project, so it makes some sense.

I understand that jenkins pipeline is bound to a single repo so it is straightforward to check for updates in repo, checkout it and start a build.

But I would like to understand what are my options when it comes to observe two repos R1 and R2, where changes can be done in any of those and jenkins should start build after a push. For simplicity I would assume that R1 and R2 both have master or branch-A created.

I could imagine I have two pipelines - one in R1 and one in R2. but how do I later coordinate output from those two pipelines?


Solution

  • You can use the generic webhook trigger plugin. Then add the webhook to both Repos. So both repos will trigger the same pipline. The trigger plugin will give you the repo and branch name. So you can checkout and build the triggerin repo.