[英]AWS CodeBuild: How to force buildspec.yml quit on error
I have a buildspec.yml consumed by AWS CodeBuild with build and post_build tasks.我有一个由 AWS CodeBuild 使用的 buildspec.yml 和 build 和 post_build 任务。 I was a bit surprised when I found out that post_build tasks are executed even if any of build commands fail.
当我发现即使任何构建命令失败也会执行 post_build 任务时,我有点惊讶。
How is possible to force quit of execution if any of build commands fail?如果任何构建命令失败,如何强制退出执行?
Thanks!谢谢!
version: 0.2
env:
variables:
S3_BUCKET: "..."
BUILD_ENV : "prod"
phases:
install:
commands:
- echo Installing source NPM dependencies...
- npm install
- npm install -g @angular/cli
build:
commands:
- echo Build started on `date`
- ng build --prod --aot --source-map=false
post_build:
commands:
- echo Running post_build commands on `date`
- aws s3 sync dist s3://${S3_BUCKET} --recursive
- aws cloudfront create-invalidation --distribution-id XXXXXXXXXXXXXX --paths '/index.html'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.