当我使用 GitHub 在 AWSCodeDeploy 中创建新部署时,我收到以下失败消息:
Error CodeScriptFailed
Script Namescripts/stop_server.sh
MessageScript at specified location: scripts/stop_server.sh run as user ubuntu failed with exit code 1
Log TailLifecycleEvent - ApplicationStop
Script - scripts/stop_server.sh
[stderr]su: user ubuntu does not exist
但是,我的实例是 Amazon Linux 实例,没有ubuntu
用户,有人知道吗?
尝试运行的脚本是:
# scripts/stop_server.sh
#!/bin/bash
forever stop .
我的 appspec.yml 文件:
version: 0.0
os: linux
files:
- source: /
destination: /home/ec2-user
hooks:
AfterInstall:
- location: scripts/install_dependencies.sh
timeout: 5
runas: root
ApplicationStart:
- location: scripts/start_server.sh
timeout: 5
runas: root
ApplicationStop:
- location: scripts/stop_server.sh
timeout: 5
runas: root
Codedeploy-代理版本agent_version: OFFICIAL_1.0-1.1095_rpm