如何看到上传的菜谱失败了?

时间:2014-12-15 08:03:42

标签: ruby chef chef-recipe cookbook

我尝试上传带有依赖项的cookbook,这是一个日志:

[root@redhat cookbooks]# knife cookbook upload reference-app --include-dependencies
Uploading my-cookbook  [0.1.0]
Uploading maven          [1.2.0]
Uploading hipsnip-jetty  [0.9.0]
Uploading ark            [0.9.0]
Uploading java           [1.29.0]
Uploading windows        [1.34.8]
Uploading 7-zip          [1.0.2]
Uploading chef_handler   [1.1.6]
WARNING: Uploaded 8 cookbooks ok but 2 cookbooks upload failed.

全是日志。有没有办法确定哪些食谱确实失败了?

1 个答案:

答案 0 :(得分:0)

使用详细标记将显示无法正确上传的原因。

例如,我在apt cookbook中添加了一些不好的代码......

[scarman@coldlight cookbooks]$ knife cookbook upload apt --include-dependencies -n -V
Uploading apt            [2.6.0]
INFO: Validating ruby files
FATAL: Cookbook file recipes/default.rb has a ruby syntax error:
FATAL: /home/scarman/DevOps/cookbooks/apt/recipes/default.rb:29: `@#' is not allowed as an instance variable name
FATAL: /home/scarman/DevOps/cookbooks/apt/recipes/default.rb:29: syntax error, unexpected end-of-input, expecting '('
FATAL: uha897*@S::@#!!
FATAL:             ^

并且还关闭了我的网络......

[scarman@coldlight cookbooks]$ knife cookbook upload apt --include-dependencies -n -V
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 1/5
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 2/5
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 3/5
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 4/5
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 5/5
ERROR: Network Error: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all - getaddrinfo: Name or service not known
Check your knife configuration and network settings

这应该有希望为您提供更多有关其失败原因的见解。