buildspec、appspec 和滚动我自己的 AMI 之间有什么区别?
除了结构之外,我对 buildspec.yml
和 appspec.yml
文件之间的差异感到相当困惑。我的构建规范中的阶段命令似乎对部署环境没有太大影响,并且在运行过程(例如安装)时使用哪个 appspec 挂钩之间也存在类似的模糊性。只要该过程发生在需要它的阶段之前,我就看不到阶段之间的差异。 (我已阅读规范参考文档;他们大多确认这些阶段的标题是出于其目的,但并不是真正的目的。)
举个例子,为什么我每次不直接用 packer 烘焙我自己的 AMI进行部署,然后启动新主机并附加 AMI?
I'm fairly confused about how the buildspec.yml
and the appspec.yml
files differ from one another, aside from structure. It doesn't seem like the phase commands from my buildspec have much effect on the deployment environment, and there is similar ambiguity between which appspec hook to use when running a procedure, like an installation. So long as the procedure happens before the phase that needs it, I don't see the difference in the phases. (I have read the spec reference docs; they mostly confirm that the phases are titled for their purpose, but not really what the purpose is.)
As an example, why wouldn't I just bake my own AMIs with packer each time I had to do a deployment, and then standup a new host and attach the AMI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
干得好。
buildspec.yml
该文件用于根据管道创建的源工件进行构建。同样,这仅对于需要构建的应用程序(例如 Angular、React 等)来说是必需的。如果您有 NodeJS 应用程序,则不需要此文件。
appspec.yml
如果您尝试将应用程序部署到 EC2 实例,则需要此文件。为 EC2 实例创建的部署组将在您的根目录中查找此文件,其中包含文件在 ec2 实例中被 overtite 后需要遵循的一系列指令。
例如:如果您有 NodeJS 应用程序,那么它需要重新运行命令运行应用程序。
想要添加一些更多的不同吗?请评论。
Here you go.
buildspec.yml
This file is use to make build from the source artifact created by pipeline. Again this is only necessary for the application which require to make build such as angular, react etc. if you have nodejs application you do not need this file.
appspec.yml
This file is required if you are trying to deploy your application to an EC2 instance. The deployment group that is created for the EC2 instance will look for this file in your root which contain series of instruction that need to be followed after the files have been overtite in the ec2 instance.
for eg: if you have nodejs application then it requires to re-run the command run application.
Want to add some more differene ? Please comment.