伯克对厨房的依赖 ci

Berk depedency with kitchen ci

我不知道如何用厨房 ci 正确地制作我的食谱 运行。这是我写和执行的:

kitchen.yml

driver:
  name: docker
  binary: docker
  use_sudo: false

provisioner:
  name: chef_zero
  always_update_cookbooks: true
  chef_repo_path: ../..
  nodes: ../../nodes

platforms:
  - name: ubuntu-16.04
    driver_plugin: docker

suites:
  - name: default
    data_bags_path: "../../data_bags"
    encrypted_data_bag_secret_key_path: "../../data_bags/secrets/bitbucket.json"
    run_list:
            - recipe[redmine_test]

verifier:
  name: inspec

我的食谱文件夹中的 Berks 文件:

source 'https://supermarket.chef.io'
metadata
cookbook 'nginx', '~> 2.7.6'
cookbook 'logrotate', '~> 1.9.2'

我运行的命令:

$ berks vendor
$ kitchen create && kitchen converge -l debug

This is the error I get:
 ================================================================================
       Recipe Compile Error in /tmp/kitchen/cache/cookbooks/redmine_test/recipes/default.rb
       ================================================================================

       NoMethodError
       -------------
       undefined method `[]' for nil:NilClass

       Cookbook Trace:
       ---------------
         /tmp/kitchen/cache/cookbooks/redmine_test/recipes/default.rb:73:in `block in from_file'
         /tmp/kitchen/cache/cookbooks/redmine_test/recipes/default.rb:70:in `from_file'

       Relevant File Content:
       ----------------------
       /tmp/kitchen/cache/cookbooks/redmine_test/recipes/default.rb:

        66:      action :add
        67:    end
        68:  end
        69:  
        70:  directory "redmine_repos" do
        71:    path lazy { "#{node['etc']['passwd'][node['redmine']['user']]['dir']}/repos" }
        72:    owner node['redmine']['user']
        73>>   group node['nginx']['group']
        74:    mode 02775
        75:  end
        76:  

我怎么会收到这个错误?而 group node['nginx']['group'] 变量在已销售的 nginx 食谱中有明确定义。

谢谢

nginx 食谱必须是您 metadata.rb 的一部分 (depends nginx)。或者它必须在您的 run_list.

另外,2.7.6已经很老了,已经有7.x了。