build-image icon indicating copy to clipboard operation
build-image copied to clipboard

Netlify and lerna Difficulties

Open mrfambo opened this issue 5 years ago • 1 comments

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:

  1. In netlify.toml
[build]
  environment = { API_SERVER = "$API_SERVER", NODE_ENV = "$NODE_ENV", DIFF = "$DIFF" }
  ignore = "$DIFF"
  1. I provide a DIFF variable from netlify ui like this git diff --quiet HEAD^ HEAD projects/Portal in portal netlify site and git diff --quiet HEAD^ HEAD projects/Doctor in 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

mrfambo avatar Aug 27 '20 19:08 mrfambo

In build logs: 12:37:41 AM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: '$DIFF'

mrfambo avatar Aug 27 '20 19:08 mrfambo