Ruby 主厨索洛罐头';在厨房试运行期间找不到烹饪书

Ruby 主厨索洛罐头';在厨房试运行期间找不到烹饪书,ruby,chef-infra,chef-solo,berkshelf,test-kitchen,Ruby,Chef Infra,Chef Solo,Berkshelf,Test Kitchen,我正在尝试为一堆烹饪书添加一个测试厨房,我们使用这些烹饪书来提供Jenkins CI实例 我们使用Berkshelf来管理依赖关系。文件结构如下: | .gitignore | .kitchen.yml | Berksfile | Berksfile.lock | bootstrap.sh | chefignore | metadata.rb | provision.sh | readme.md | solo.json | solo.rb | tr

我正在尝试为一堆烹饪书添加一个测试厨房,我们使用这些烹饪书来提供Jenkins CI实例

我们使用Berkshelf来管理依赖关系。文件结构如下:

|   .gitignore
|   .kitchen.yml
|   Berksfile
|   Berksfile.lock
|   bootstrap.sh
|   chefignore
|   metadata.rb
|   provision.sh
|   readme.md
|   solo.json
|   solo.rb
|   tree.txt
|   VERSION
|   
+---.kitchen
|   |   default-ubuntu-1404.yml
|   |   
|   +---kitchen-vagrant
|   |   \---kitchen-chef-jenkins-default-ubuntu-1404
|   |       |   Vagrantfile
|   |       |   
|   |       \---.vagrant
|   |           \---machines
|   |               \---default
|   |                   \---virtualbox
|   |                           action_set_name
|   |                           id
|   |                           index_uuid
|   |                           private_key
|   |                           synced_folders
|   |                           
|   \---logs
|           default-centos-71.log
|           default-ubuntu-1404.log
|           kitchen.log
|           
+---site-cookbooks
|   +---ant
|   |   |   .gitignore
|   |   |   .kitchen.yml
|   |   |   Berksfile
|   |   |   CHANGELOG.md
|   |   |   chefignore
|   |   |   CONTRIBUTING.md
|   |   |   LICENSE
|   |   |   metadata.rb
|   |   |   README.md
|   |   |   TESTING.md
|   |   |   Thorfile
|   |   |   
|   |   +---attributes
|   |   |       default.rb
|   |   |       
|   |   +---providers
|   |   |       library.rb
|   |   |       
|   |   +---recipes
|   |   |       default.rb
|   |   |       install_package.rb
|   |   |       install_source.rb
|   |   |       
|   |   +---resources
|   |   |       library.rb
|   |   |       
|   |   \---templates
|   |       \---default
|   |               ant_home.sh.erb
|   |               
|   +---haxe_cookbook
|   |   |   CHANGELOG.md
|   |   |   metadata.rb
|   |   |   README.md
|   |   |   
|   |   \---recipes
|   |           default.rb
|   |           
|   \---mbp-jenkins
|       |   Berksfile
|       |   Berksfile.lock
|       |   CHANGELOG.md
|       |   chefignore
|       |   metadata.rb
|       |   README.md
|       |   
|       +---recipes
|       |       default.rb
|       |       
|       +---resources
|       |   |   commons-net-3.3.jar
|       |   |   
|       |   +---css
|       |   |       style.css
|       |   |       
|       |   +---images
|       |   |       logo-mbp.png
|       |   |       web.png
|       |   |       
|       |   \---js
|       |           scripts.js
|       |           
|       \---templates
|           +---default
|           |   |   config.xml
|           |   |   
|           |   \---secrets
|           |           hudson.console.AnnotatedLargeText.consoleAnnotator
|           |           hudson.model.Job.serverCookie
|           |           hudson.util.Secret
|           |           jenkins.security.ApiTokenProperty.seed
|           |           jenkins.slaves.JnlpSlaveAgentProtocol.secret
|           |           master.key
|           |           org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices.mac
|           |           org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
|           |           
|           \---emails
|                   build-complete.html.groovy
|                   build-started.html.groovy
|                   
\---test
    \---integration
        \---default
root = File.absolute_path(File.dirname(__FILE__))

file_cache_path 'cache'
cookbook_path [root + "/cookbooks", root + "/site-cookbooks",root + "/berks-cookbooks"]
source 'https://supermarket.chef.io'

cookbook 'ant',           path: 'site-cookbooks/ant'
cookbook 'haxe_cookbook', path: 'site-cookbooks/haxe_cookbook'
cookbook 'mbp-jenkins',   path: 'site-cookbooks/mbp-jenkins'

metadata
执行:

kitchen converge default-ubuntu-1404
导致以下错误:

    [2015-08-24T09:13:24+00:00] ERROR: Cookbook mbp-jenkins not found. If you're loading mbp-jenkins from another cookbook, make sure you configure the dependency in your metadata
[2015-08-24T09:13:24+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
这表明索洛厨师找不到食谱mbp詹金斯。我希望它能在solo.rb文件中定义cookbook路径时找到它,如下所示:

|   .gitignore
|   .kitchen.yml
|   Berksfile
|   Berksfile.lock
|   bootstrap.sh
|   chefignore
|   metadata.rb
|   provision.sh
|   readme.md
|   solo.json
|   solo.rb
|   tree.txt
|   VERSION
|   
+---.kitchen
|   |   default-ubuntu-1404.yml
|   |   
|   +---kitchen-vagrant
|   |   \---kitchen-chef-jenkins-default-ubuntu-1404
|   |       |   Vagrantfile
|   |       |   
|   |       \---.vagrant
|   |           \---machines
|   |               \---default
|   |                   \---virtualbox
|   |                           action_set_name
|   |                           id
|   |                           index_uuid
|   |                           private_key
|   |                           synced_folders
|   |                           
|   \---logs
|           default-centos-71.log
|           default-ubuntu-1404.log
|           kitchen.log
|           
+---site-cookbooks
|   +---ant
|   |   |   .gitignore
|   |   |   .kitchen.yml
|   |   |   Berksfile
|   |   |   CHANGELOG.md
|   |   |   chefignore
|   |   |   CONTRIBUTING.md
|   |   |   LICENSE
|   |   |   metadata.rb
|   |   |   README.md
|   |   |   TESTING.md
|   |   |   Thorfile
|   |   |   
|   |   +---attributes
|   |   |       default.rb
|   |   |       
|   |   +---providers
|   |   |       library.rb
|   |   |       
|   |   +---recipes
|   |   |       default.rb
|   |   |       install_package.rb
|   |   |       install_source.rb
|   |   |       
|   |   +---resources
|   |   |       library.rb
|   |   |       
|   |   \---templates
|   |       \---default
|   |               ant_home.sh.erb
|   |               
|   +---haxe_cookbook
|   |   |   CHANGELOG.md
|   |   |   metadata.rb
|   |   |   README.md
|   |   |   
|   |   \---recipes
|   |           default.rb
|   |           
|   \---mbp-jenkins
|       |   Berksfile
|       |   Berksfile.lock
|       |   CHANGELOG.md
|       |   chefignore
|       |   metadata.rb
|       |   README.md
|       |   
|       +---recipes
|       |       default.rb
|       |       
|       +---resources
|       |   |   commons-net-3.3.jar
|       |   |   
|       |   +---css
|       |   |       style.css
|       |   |       
|       |   +---images
|       |   |       logo-mbp.png
|       |   |       web.png
|       |   |       
|       |   \---js
|       |           scripts.js
|       |           
|       \---templates
|           +---default
|           |   |   config.xml
|           |   |   
|           |   \---secrets
|           |           hudson.console.AnnotatedLargeText.consoleAnnotator
|           |           hudson.model.Job.serverCookie
|           |           hudson.util.Secret
|           |           jenkins.security.ApiTokenProperty.seed
|           |           jenkins.slaves.JnlpSlaveAgentProtocol.secret
|           |           master.key
|           |           org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices.mac
|           |           org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
|           |           
|           \---emails
|                   build-complete.html.groovy
|                   build-started.html.groovy
|                   
\---test
    \---integration
        \---default
root = File.absolute_path(File.dirname(__FILE__))

file_cache_path 'cache'
cookbook_path [root + "/cookbooks", root + "/site-cookbooks",root + "/berks-cookbooks"]
source 'https://supermarket.chef.io'

cookbook 'ant',           path: 'site-cookbooks/ant'
cookbook 'haxe_cookbook', path: 'site-cookbooks/haxe_cookbook'
cookbook 'mbp-jenkins',   path: 'site-cookbooks/mbp-jenkins'

metadata
我真的不知道这里出了什么问题,所以任何建议都将不胜感激

更新:

我曾尝试使用chef zero provisioner,但它提供了以下输出:

================================================================================
Error Resolving Cookbooks for Run List:
================================================================================

Missing Cookbooks:
------------------
No such cookbook: mbp-jenkins

Expanded Run List:
------------------
* mbp-jenkins::default

你试过使用chef_zero供应器吗?我怀疑你的问题是因为厨师索洛没有经营Berkshelf,这可以解释为什么会丢失烹饪书

例如,请参见:

更新 问题似乎是站点cookbooks目录中的cookbooks没有复制到目标机器

在我看来,最简单和最好的解决办法是在您的Berksfile中包含本地食谱,如下所示:

|   .gitignore
|   .kitchen.yml
|   Berksfile
|   Berksfile.lock
|   bootstrap.sh
|   chefignore
|   metadata.rb
|   provision.sh
|   readme.md
|   solo.json
|   solo.rb
|   tree.txt
|   VERSION
|   
+---.kitchen
|   |   default-ubuntu-1404.yml
|   |   
|   +---kitchen-vagrant
|   |   \---kitchen-chef-jenkins-default-ubuntu-1404
|   |       |   Vagrantfile
|   |       |   
|   |       \---.vagrant
|   |           \---machines
|   |               \---default
|   |                   \---virtualbox
|   |                           action_set_name
|   |                           id
|   |                           index_uuid
|   |                           private_key
|   |                           synced_folders
|   |                           
|   \---logs
|           default-centos-71.log
|           default-ubuntu-1404.log
|           kitchen.log
|           
+---site-cookbooks
|   +---ant
|   |   |   .gitignore
|   |   |   .kitchen.yml
|   |   |   Berksfile
|   |   |   CHANGELOG.md
|   |   |   chefignore
|   |   |   CONTRIBUTING.md
|   |   |   LICENSE
|   |   |   metadata.rb
|   |   |   README.md
|   |   |   TESTING.md
|   |   |   Thorfile
|   |   |   
|   |   +---attributes
|   |   |       default.rb
|   |   |       
|   |   +---providers
|   |   |       library.rb
|   |   |       
|   |   +---recipes
|   |   |       default.rb
|   |   |       install_package.rb
|   |   |       install_source.rb
|   |   |       
|   |   +---resources
|   |   |       library.rb
|   |   |       
|   |   \---templates
|   |       \---default
|   |               ant_home.sh.erb
|   |               
|   +---haxe_cookbook
|   |   |   CHANGELOG.md
|   |   |   metadata.rb
|   |   |   README.md
|   |   |   
|   |   \---recipes
|   |           default.rb
|   |           
|   \---mbp-jenkins
|       |   Berksfile
|       |   Berksfile.lock
|       |   CHANGELOG.md
|       |   chefignore
|       |   metadata.rb
|       |   README.md
|       |   
|       +---recipes
|       |       default.rb
|       |       
|       +---resources
|       |   |   commons-net-3.3.jar
|       |   |   
|       |   +---css
|       |   |       style.css
|       |   |       
|       |   +---images
|       |   |       logo-mbp.png
|       |   |       web.png
|       |   |       
|       |   \---js
|       |           scripts.js
|       |           
|       \---templates
|           +---default
|           |   |   config.xml
|           |   |   
|           |   \---secrets
|           |           hudson.console.AnnotatedLargeText.consoleAnnotator
|           |           hudson.model.Job.serverCookie
|           |           hudson.util.Secret
|           |           jenkins.security.ApiTokenProperty.seed
|           |           jenkins.slaves.JnlpSlaveAgentProtocol.secret
|           |           master.key
|           |           org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices.mac
|           |           org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
|           |           
|           \---emails
|                   build-complete.html.groovy
|                   build-started.html.groovy
|                   
\---test
    \---integration
        \---default
root = File.absolute_path(File.dirname(__FILE__))

file_cache_path 'cache'
cookbook_path [root + "/cookbooks", root + "/site-cookbooks",root + "/berks-cookbooks"]
source 'https://supermarket.chef.io'

cookbook 'ant',           path: 'site-cookbooks/ant'
cookbook 'haxe_cookbook', path: 'site-cookbooks/haxe_cookbook'
cookbook 'mbp-jenkins',   path: 'site-cookbooks/mbp-jenkins'

metadata

我不认为这是问题所在——看起来Berkshelf运行已成功完成。找不到的cookbook实际上位于/site cookbooks/目录中,并且不是由Berkshelf管理的依赖项。我已经更新了我的问题,以包括chef zero给我的输出。我认为问题在于chef没有在/site cookbooks/目录中查找mbp jenkinscookbook@PiX06也许你应该把所有的食谱都包括在你的伯克斯档案里?