目前我正在使用 AWS CodeBuild 来部署我的 monorepo 项目,并且我正在尝试使用它的缓存属性。我想缓存我的node_modules
文件夹,我buildspec.yml
的是:
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/**/*'
有没有办法使用通配符将所有内容添加node_modules
到路径?
我的存储库结构是:
root
node_modules
packages
lambdas
node_modules
...
web
node_modules
...
...
谢谢!
更新 1 (05/14/16):
我收到这个错误
[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
当我使用
cache:
paths:
- '*/**/node_modules/**/*'