在 appspec.yml 中提到可执行文件的位置 [英] Where to mention executable file in appspec.yml

查看:29
本文介绍了在 appspec.yml 中提到可执行文件的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过 github 在 AWC EC2 上部署和运行一个简单的 python 应用程序(discord bot).我已经设置了 CodeDeploy 和 CodePipeline

  1. 我需要 CodeBuild 吗?
  2. 我在 appspec.yml 中的何处提及我的 main.py 可执行文件来运行代码?
  3. appspec.yml 文件中有哪些重要的钩子(BeforeInstall、AfterInstall、ApplicationStart、ApplicationStop)?

解决方案

我需要 CodeBuild 吗?

取决于您的应用程序.有些人可能需要,有些人可能不需要.

<块引用>

我在 appspec.yml 中的哪里提到我的 main.py 可执行文件来运行代码?

appspec.yml 只是在实例 shell 中运行命令.因此,您可以像通常在实例上手动运行它一样执行 main.py,例如

钩子:安装前:- 位置:脚本/RynMyPyton.sh

scripts/RynMyPyton.sh 在哪里

#!bin/bash蟒蛇主.py

<块引用>

appspec.yml 文件中哪些钩子(BeforeInstall、AfterInstall、ApplicationStart、ApplicationStop)都很重要?

它们在 这里.

I am trying to deploy and run a simple python application (discord bot) on AWC EC2 through github. I have setup CodeDeploy and CodePipeline

  1. Do I need the CodeBuild?
  2. Where do I mention my main.py executable in appspec.yml to run the code?
  3. What all hooks(BeforeInstall, AfterInstall, ApplicationStart, ApplicationStop) are important in appspec.yml file?

解决方案

Do I need the CodeBuild?

Depends on your application. For some it may be required, for others may not.

Where do I mention my main.py executable in appspec.yml to run the code?

appspec.yml just runs commands in the instance shell. So you execute your main.py as you would normally run it manually on the instance, e.g.

hooks:
  BeforeInstall:
    - location: scripts/RynMyPyton.sh

where scripts/RynMyPyton.sh would be

#!bin/bash

python main.py

What all hooks(BeforeInstall, AfterInstall, ApplicationStart, ApplicationStop) are important in appspec.yml file?

They are explained in here.

这篇关于在 appspec.yml 中提到可执行文件的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆