Chrissisbeast
Chrissisbeast

Reputation: 51

AWS codepipline rebuild only the affected monorepo apps

I have a NX Monorepo with 2 react applications and a shared library between them:

-apps -app1 -app2 -libs -global files for both apps

I have them both deployed on AWS codepipeline with s3 bucket and they share one monorepo repository, but the main issue here is that whenever I push some changes to the repo, no matter if they are in the libs(shared) or the app itself, the pipeline rebuilds all of the applications I have, my expected results are if I change something in the libs for example to rebuild all projects, because it affects them, but if I do a change in app1, which doesn't affect app2, AWS to rebuild only app1. I read a lot of posts and landed on Lambdas and Lerna js, but everything looks pretty complicated since I am new to AWS

this is an image I landed on, it shows that I need to use lamba functions to check which part of the repo is changed and determine which pipline to rebuild, I would be really glad if someone simpliefies things for me so I can find easier solution or if someone dealt with this problem to help me find a solution.

Upvotes: 2

Views: 1277

Answers (1)

Marko Eskola
Marko Eskola

Reputation: 818

If you use codepipeline/codebuild with a self-created build server container image including nx you don't need that logic. In that scenario nx inside build server watches for changes and builds only needed changes. Obviously you have to use EFS etc. for persistence.

Upvotes: 0

Related Questions