当我尝试部署时,CodeDeploy 出现 Ruby 错误
CodeDeploy giving a Ruby error when I try to deploy
appspec.yml:
version: 0.0
os: linux
files:
- source: /
destination: /var/ingester
permissions:
- object: /var
pattern: ingester
owner: ubuntu
group: ubuntu
type:
- directory
- object: /var/ingester
owner: ubuntu
group: ubuntu
hooks:
ApplicationStart:
- location: deployment/start.sh
runas: ubuntu
Codedeploy 进入 BeforeInstall,然后出现错误:
ERROR [codedeploy-agent(2735)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Error during perform: TypeError - no implicit conversion of String into Integer - /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/application_specification/application_specification.rb:49:in `[]'
看起来好像这与 YAML 的解析有关,但我无法弄清楚它试图(和失败)转换为整数的内容。
谁能看出这里出了什么问题?
在 Ravi 的提示下(见 OP 评论),我检查了 EC2 框上的 appspec.yml,它似乎是一个旧副本,在 YAML 中缺少 source:
之前的连字符.因此,Ruby 将其解释为散列而不是数组。
appspec.yml:
version: 0.0
os: linux
files:
- source: /
destination: /var/ingester
permissions:
- object: /var
pattern: ingester
owner: ubuntu
group: ubuntu
type:
- directory
- object: /var/ingester
owner: ubuntu
group: ubuntu
hooks:
ApplicationStart:
- location: deployment/start.sh
runas: ubuntu
Codedeploy 进入 BeforeInstall,然后出现错误:
ERROR [codedeploy-agent(2735)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Error during perform: TypeError - no implicit conversion of String into Integer - /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/application_specification/application_specification.rb:49:in `[]'
看起来好像这与 YAML 的解析有关,但我无法弄清楚它试图(和失败)转换为整数的内容。
谁能看出这里出了什么问题?
在 Ravi 的提示下(见 OP 评论),我检查了 EC2 框上的 appspec.yml,它似乎是一个旧副本,在 YAML 中缺少 source:
之前的连字符.因此,Ruby 将其解释为散列而不是数组。