В настоящее время я использую 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 (14.05.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/**/*'