1

I am pondering moving some parts of the system I work on to a monorepo. The structure I have now is something like:

+- Project 1 +- pom.xml
|            +- Jenkinsfile
|            +- Dockerfile
+- Project 2 +- pom.xml
|            +- Jenkinsfile
|            +- Dockerfile
...
+- pom.xml (parent)
+- Jenkinsfile

What I want to achieve is to trigger another Jenkins pipeline based on the changeset from the top-level one based on the change set contents.

when { changeset "*/Project1/**"} 
 ...

All the children pipelines are just calling a pipeline library with some parameters - this works pretty well and I would like to keep the code.

What options do I have?

5
  • Advantage of a monorepo is that you have only one build at the root. Granted, Maven isn't awesome at detecting if there are no changes to a sub-module, so the downside is that you will have a number of builds kicking off. If you are trying to treat a monorepo like a polyrepo, you don't get any of the advantages of the monorepo. What's your end state goal here? Commented Nov 29, 2021 at 18:23
  • @BerinLoritsch: Monorepo implies versioning things together but does not enforce any building discipline. My goal is to build just the services that have changes not all the services in the repo. It makes no sense for me to build about 84 projects just because I have changes in a single one. The big advantage I get with a monorepo is easy refactoring, simplified versioning process - single PR for changes in multiple modules +bonus: simplified versioning and dependency management between projects. Commented Nov 29, 2021 at 19:16
  • I know it doesn't force that. But I have 45 different builds to create one product. That's coming from a polyrepo situation. Reducing the number of builds would make monitoring and managing the builds a lot easier. Commented Nov 30, 2021 at 2:21
  • @BerinLoritsch: Ultimately that would happen. The problem is that I cannot stop the world and redo all pipeline - there is already much turmoil for the monorepo. Commented Nov 30, 2021 at 12:33
  • Understood. So your question is along the lines of treating a mono-repo like a polyrepo until you have the bandwidth to restructure the build? Commented Nov 30, 2021 at 19:28

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.