Currently I'm using AWS CodeBuild to deploy my monorepo project and I'm trying to use its cache properties. I want to cache my node_modules
folder and my buildspec.yml
is:
version: 0.2
phases:
install:
commands:
- echo Entered the install phase...
- npm install
finally:
- echo This always runs even if the update or install command fails
pre_build:
commands:
- echo Entered the pre_build phase...
finally:
- echo This always runs even if the login command fails
build:
commands:
- echo Entered the build phase...
- echo Build started on `date`
- npm run build
finally:
- echo This always runs even if the install command fails
post_build:
commands:
- echo "Entered the post_build phase (deploy)..."
- npm run deploy
- echo deploy completed on `date`
cache:
paths:
- 'node_modules/**/*'
- 'packages/lambdas/node_modules/**/*'
- 'packages/web/node_modules/**/*'
Is there a way to use a wildcard to add all node_modules
to path?
My repository structure is:
root
node_modules
packages
lambdas
node_modules
...
web
node_modules
...
...
Thank you!
Update 1 (05/14/16):
I get this error
[Container] 2019/05/14 23:19:24 Symlinking: /codebuild/output/src986466269/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/MYREPOSITORY/*/**/node_modules => /codebuild/local-cache/custom/7bd9b9fb12a6f74162020f29bfde2b34c52fdde87977fb9dda31fcbbb33f01af/*/**/node_modules
[Container] 2019/05/14 23:19:24 Error mounting /codebuild/output/src986466269/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/MY_REPOSITORY/*/**/node_modules: symlink /codebuild/local-cache/custom/7bd9b9fb12a6f74162020f29bfde2b34c52fdde87977fb9dda31fcbbb33f01af/*/**/node_modules /codebuild/output/src986466269/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/MY_REPOSITORY/*/**/node_modules: no such file or directory
when I use
cache:
paths:
- '*/**/node_modules/**/*'