[英]Why do AWS CodeBuild buildspec.yml support multiple build phases?
Why does the buildspec file support multiple build phases?为什么 buildspec 文件支持多个构建阶段? install, pre_build, build, post_build
? install, pre_build, build, post_build
? Am I doing something wrong if I put all of my build steps into a single phase?如果我将所有构建步骤都放在一个阶段,我是否做错了什么? Is there something very useful, except for keeping some kind of structure, with these phases?除了保持某种结构之外,有什么非常有用的东西吗?
Failures in some phases will cause the build to exit, whilst others will not.某些阶段的失败将导致构建退出,而其他阶段则不会。 This article spells it out pretty well: https://docs.aws.amazon.com/codebuild/latest/userguide/view-build-details.html#view-build-details-phases这篇文章很好地说明了这一点: https : //docs.aws.amazon.com/codebuild/latest/userguide/view-build-details.html#view-build-details-phases
Yeah, we can do all the things in one phase (ie build phase).是的,我们可以在一个阶段(即构建阶段)完成所有事情。 But it is not recommended, if any thing fails it will be hard to debug especially when there is lot of things going on your build stage.但不建议这样做,如果有任何事情失败,将很难调试,尤其是当您的构建阶段有很多事情发生时。
INSTALL STAGE - install or upgrate something like java version, node version, gatsby.. etc安装阶段- 安装或升级诸如 Java 版本、节点版本、gatsby 等内容
PRE_BUILD - node modules, composer packages.. etc PRE_BUILD - 节点模块、作曲家包.. 等
BUILD - your build commands. BUILD - 您的构建命令。
POST_BUILD - things to do after build. POST_BUILD - 构建后要做的事情。 Like uploading to S3.就像上传到S3。
If your Build is just one or two commands, Just go with the BUILD phase alone.如果您的 Build 只是一两个命令,则只需执行 BUILD 阶段即可。
Note: Uploading to s3 can also be done using ARTIFACT section.注意:上传到 s3 也可以使用ARTIFACT部分完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.