Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
feat: package manager detection for mono repositories (#858)
Browse files Browse the repository at this point in the history
* feat: package manager detection for mono repositories

* chore: add some way for local running the script

* chore: updates

* chore: fix docker test image

* chore: make it run locally

* chore: make monorepo locally testable

* chore: add debug logging

* Update run-build.sh

Co-authored-by: João Antunes <[email protected]>

* chore: PR feedback from Joao

* chore: fix hadolint

Co-authored-by: João Antunes <[email protected]>
  • Loading branch information
lukasholzer and JGAntunes authored Nov 17, 2022
1 parent 849f904 commit e0cd187
Show file tree
Hide file tree
Showing 9 changed files with 1,864 additions and 61 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,11 @@ FROM build-image as build-image-test
USER buildbot
SHELL ["/bin/bash", "-c"]

COPY --chown=buildbot:buildbot package.json /opt/buildhome/test-env/package.json
COPY --chown=buildbot:buildbot package.json package-lock.json /opt/buildhome/test-env/

# We need to install with `--legacy-peer-deps` because of:
# https://github.com/bats-core/bats-assert/issues/27
RUN cd /opt/buildhome/test-env && . ~/.nvm/nvm.sh && npm i --legacy-peer-deps &&\
RUN cd /opt/buildhome/test-env && . ~/.nvm/nvm.sh && npm ci --legacy-peer-deps &&\
ln -s /opt/build-bin/run-build-functions.sh /opt/buildhome/test-env/run-build-functions.sh &&\
ln -s /opt/build-bin/build /opt/buildhome/test-env/run-build.sh

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ Here is an example that sets `NODE_VERSION` and `NODE_ENV` before running a buil
export NODE_VERSION=8 NODE_ENV=production ; build npm run build
```

### Testing it for a mono repository

If you like to run a debugging build for your mono repository you need to pass the **Base directory** like in the Netlify UI.

```
./test-tools/test-build.sh path/to/site/repo base/directory 'your build command'
```

### Testing locally with cache

If you'd like to run a debugging build using our caching mechanisms, with verbose shell output, you can replace steps 2 and 3 above with the following command:
Expand Down
Loading

0 comments on commit e0cd187

Please sign in to comment.