build-image
build-image copied to clipboard
Netlify and lerna Difficulties
My project structure looks like this:
- root
- projects
- API (not something deployed on netlify)
- Doctor (React App, Deployed on netlify, having its own netlify site)
- Portal (React App, Deployed on netlify, having its own netlify site)
- interfaces
- packages
- lerna.json
- package.json
In Each site build settings. i do provide a build command lerna bootstrap && lerna run build:portal in case of portal and in case of Doctor the site comes up with its own build command.
ITS WORKING LIKE A CHARM.
Now here is the freaking problem: "How to stop build on Doctor if i changed Portal only or vice versa"
Here is what i am doing now and its not working:
- In
netlify.toml
[build]
environment = { API_SERVER = "$API_SERVER", NODE_ENV = "$NODE_ENV", DIFF = "$DIFF" }
ignore = "$DIFF"
- I provide a DIFF variable from netlify ui like this
git diff --quiet HEAD^ HEAD projects/Portalin portal netlify site andgit diff --quiet HEAD^ HEAD projects/Doctorin doctor netlify site.
But it's not working. Builds are still being done and no matter which files got changed out of the directory, they are still causing the build to proceed.
Every site have a specific diff command like git diff --quiet HEAD^ HEAD projects/Portal is for Portal and git diff --quiet HEAD^ HEAD projects/Doctor, hence i can't put them directly in netlify.toml
In build logs:
12:37:41 AM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: '$DIFF'