我正在尝试使用 AWS CodeDeploy 和 CircleCI 设置 CI。现在我被困在 AWS CodeDeploy 应该将内容复制到 EC2 并运行脚本的步骤上。但不知何故,CircleCI 告诉我出了点问题。有谁知道可能会发生什么?谢谢。
appspec.yml 是:
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu
hooks:
BeforeInstall:
- location: scripts/setup.sh
timeout: 3800
runas: root
ApplicationStart:
- location: scripts/start.sh
timeout: 3800
runas: root
和 setup.sh 是:
#!/bin/bash
sudo apt-get install nodejs npm
npm install
在上面的代码中,我也只尝试过apt-get install nodejs npm
,但它仍然不起作用。
中的错误信息/var/log/aws/codedeploy-agent/codedeploy-agent.log
如下:
2015-10-22 08:02:54 ERROR [codedeploy-agent(1314)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Error during
perform: InstanceAgent::Plugins::CodeDeployPlugin::ScriptError - Script at specified location:
./scripts/setup.sh run as user root failed with exit code 127 - /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/hook_executor.rb:150:in `execute_script'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/hook_executor.rb:107:in `block (2 levels) in execute'
......