1

We have a monorepo that consists of multiple projects that contain a build file. How to ensure that all these projects will be built when the job is triggered?

One solution I am thinking about is creating a shell script that detects whether the folders contains a build script, add the name to a set, iterate on this set and trigger a build for all of the projects. I wonder whether this is a good approach, but it feels cumbersome.

030
  • 13,383
  • 17
  • 76
  • 178

1 Answers1

1

Build tools like or could benefit you greatly here. It would do exactly what you have in mind as long as you have child project definition (with a build.gradle in gradle or pom.xml in maven).

I would not recommend the script as it would mean you have to maintain and tweak it in the future. Instead, investing in build tools can give you great ROI as they do much more than just build.

At the end if you cannot integrate a build tool, go for the script. It is a good idea also.

Dan Cornilescu
  • 6,780
  • 2
  • 21
  • 45
gmolaire
  • 464
  • 4
  • 7