How to Set Up Conditional Builds in a Monorepo CI/CD Pipeline?

0
6
Asked By TechSeeker99 On

I'm planning to design a CI/CD pipeline that incorporates automated gates that are smart enough to only build and deploy the parts of the code that have actually changed. We're working with a monorepo that hasn't been fully structured yet, but it will follow a folder convention to help the pipeline determine what's impacted by recent changes. We have a large codebase that includes about 10 UIs, 20 APIs (built with .NET C#), around 10 databases with a total of about 500 tables, several Azure services, event-driven backend flows, and about 5 Windows services. The reason for choosing a monorepo is that many tasks span across different areas of the system. Often, a single change affects 70-80% of the services, making it inefficient to manage this across different repositories. I'm curious if anyone has experience with pipelines that conditionally build and deploy only the impacted services. I'd appreciate any examples or insights you might have.

2 Answers

Answered By CodeWiz42 On

Yes, this is totally possible! We manage user experiences for about 20 products by defining specific rules for the paths that trigger certain test suites, which helps streamline our process. We use tools like NRWL NX, which makes handling builds a lot easier. There’s an extension for .NET that works with NX, but it's still in the works. What approach did you take on the .NET side? Were you using Git to track which folders had changes during the build process?

Answered By DevGuru728 On

It's important to note that switching to a monorepo or splitting repos won’t automatically fix your issues. It sounds like you might have split your APIs unnecessarily, when they could potentially benefit from being a single monolith. Alternatively, maybe your domain boundaries aren’t well defined? Just tossing a bunch of microservices together without a plan can lead to chaos! But hey, do you have any experience with releasing just affected parts of a repository using Azure DevOps?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.