How to specify cookbook path in .kitchen.yml file?

坚强是说给别人听的谎言 提交于 2019-11-30 18:12:14

You'll want to put the path in your berksfile, which will likely end up looking like so..

source 'https://supermarket.chef.io'
cookbook 'cookbookname', path: 'relative/or/absolute/path/to/cookbook/directory'

The berksfile is also used by chef when you deploy your code so it helps if your relative file structure is the same on your machine as it is on your chef server (i.e. all cookbooks share a directory so your berksfile can use the path '../cookbookname')

You want to set it in the provisioner section:

provisioner:
  name: chef_zero
  require_chef_omnibus: 11.12.2
  cookbook_path: whatever/path/to/cookbooks

Set up a top level Berksfile where you have .kitchen.yml that contains a reference to the cookbooks you're testing. Each cookbook will declare their dependencies and berks install at the top level will ensure you have everything installed.

(I just ran into the same issue starting out with chefdk 0.4).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!