如何解决AWS CodeBuild:如果缓存的依赖项文件夹可用,则跳过安装?
我来自 Github Actions/GCP 背景。
我试图通过在缓存 node_modules
时跳过安装来节省构建时间。
我可以看到它找到了缓存的文件夹,但仍然继续安装:(line: 9,20)
我假设我的构建规范是错误的?
我的buildspec.yml
:
version: 0.2
#env:
#variables:
# key: "value"
# key: "value"
#parameter-store:
# key: "value"
# key: "value"
#secrets-manager:
# key: secret-id:json-key:version-stage:version-id
# key: secret-id:json-key:version-stage:version-id
#exported-variables:
# - variable
# - variable
#git-credential-helper: yes
#batch:
#fast-fail: true
#build-list:
#build-matrix:
#build-graph:
phases:
install:
#If you use the Ubuntu standard image 2.0 or later,you must specify runtime-versions.
#If you specify runtime-versions and use an image other than Ubuntu standard image 2.0,the build fails.
#runtime-versions:
# name: version
# name: version
commands:
- yarn install
# - command
#pre_build:
#commands:
# - command
# - command
build:
commands:
- yarn build
# - command
#post_build:
#commands:
# - command
# - command
#reports:
#report-name-or-arn:
#files:
# - location
# - location
#base-directory: location
#discard-paths: yes
#file-format: JunitXml | Cucumberjson
artifacts:
files:
- '**/*'
# - location
#name: $(date +%Y-%m-%d)
#discard-paths: yes
base-directory: public
cache:
paths:
- 'node_modules/*'
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。