简体   繁体   English

为什么 AWS CodeBuild buildspec.yml 支持多个构建阶段?

[英]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.

相关问题 AWS CodeBuild buildspec.yml 以递归方式获取所有文件和子文件夹 - AWS CodeBuild buildspec.yml get all files and subfolders recursively AWS Copilot 管道失败,为什么 CodeBuild 找不到 buildspec.yml? - AWS Copilot pipeline fails, why cant CodeBuild find buildspec.yml? 如何将环境变量传递给 AWS 代码构建的 buildspec.yml - How to pass environment variable to the buildspec.yml for AWS codebuild AWS CodeBuild:如何强制 buildspec.yml 在出错时退出 - AWS CodeBuild: How to force buildspec.yml quit on error AWS CodeBuild - BuildSpec.yml - 导出变量未解析值 - AWS CodeBuild - BuildSpec.yml - exported-variables are not resolving values 如何将环境变量添加到CodeBuild buildspec.yml? - How Do You Add Environment Variables to CodeBuild buildspec.yml? 有没有办法在 AWS CodeBuild 的 buildspec.yml 中指定手动批准阶段? - Is there a way to specify a manual approval stage within the buildspec.yml for AWS CodeBuild? 即使 buildspec.yml 中的命令失败,AWS Build Project 也会成功 - AWS Build Project succeeds even when a command fails in buildspec.yml 如何使用 AWS CodePipeline 为 Laravel 应用程序正确创建 buildspec.yml 文件 - How do I properly create buildspec.yml file for Laravel Application using AWS CodePipeline AWS CodeBuild 构建规范 - 工件部分是否提供阶段部分中的变量更改? - AWS CodeBuild buildspec - are changes to variables in phases section available in artifacts section?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM