我在做什么?
使用
codedeploy
在 ec2 中部署应用程序。
os: linux
files:
- source: /
destination: /home/ec2-user/xxx-api
file_exists_behavior: OVERWRITE
permissions:
- object: /home/ec2-user/xxx-api/zarf/aws/application_stop.sh
mode: 777
pattern: "**"
type:
- file
hook:
ApplicationStop:
- location: /home/ec2-user/xxx-api/zarf/aws/application_stop.sh
timeout: 300
runas: ec2-user
我们知道代码是从
s3
拉过来的。当我 ssh 到 ec2 时,我可以看到最新的更新。
有什么问题
看起来钩子没有运行。当我访问日志时,我看到以下错误:
InstanceAgent::Plugins::C odeDeployPlugin::CommandExecutor: Lifecycle event ApplicationXXXX is a noop
代码部署成功完成,无需运行任何脚本。
我尝试了什么
我这里也有同样的问题。挂钩似乎根本没有运行,并且 codedeploy 报告部署成功。我明白了
2024-01-11T09:59:33 INFO [codedeploy-agent(2174)]:InstanceAgent::Plugins::CodeDeployPlugin::CommandExecutor:生命周期事件 ApplicationStart 是一个 noop 2024-01-11T09:59:33 INFO [codedeploy-agent(2174)]:InstanceAgent::Plugins::CodeDeployPlugin::CommandExecutor:命令 ApplicationStart 的 Noop 检查已完成,所有生命周期事件都是 noop。