mkdir C:\vagrant && cd C:\vagrant
C:\vagrant>vagrant init
-- config.vm.box = "base"
++ config.vm.box = "precise32"
C:\vagrant>vagrant up
mkdir C:\devkit && cd C:\devkit
C:\devkit>ruby dk.rb init
[INFO] found RubyInstaller v1.9.3 at C:/Ruby193
Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.
C:\DevKit>ruby dk.rb install
[INFO] Updating convenience notice gem override for 'C:/Ruby193'
[INFO] Installing 'C:/Ruby193/lib/ruby/site_ruby/devkit.rb'
C:\DevKit>echo %PATH%
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Ruby193\bin
setx PATH "C:\DevKit\mingw\bin\;C:\DevKit\bin\"
setx PATH "%PATH%;C:\DevKit\mingw\bin\;C:\DevKit\bin\" /M
> > > .
C:\Users\cc>echo %PATH%
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Ruby193\bin;C:\DevKit\mingw\bin\;C:\DevKit\bin\
C:\>mkdir C:\kitchen && cd C:\kitchen
C:\DevKit>gem install bundler
Fetching: bundler-1.5.2.gem (100%)
Successfully installed bundler-1.5.2
1 gem installed
Installing ri documentation for bundler-1.5.2...
Installing RDoc documentation for bundler-1.5.2...
source 'https://rubygems.org'
gem 'berkshelf', '~> 2.0.0' # use for manage cookbook dependencies
gem 'chef', '~> 11.6.0'
gem 'chef-zero'
gem 'json', '1.7.7' # needed for conflict resolution
gem 'kitchen-vagrant'
gem 'test-kitchen'
C:\kitchen>bundle install
Fetching gem metadata from rubygems.org.......
Fetching additional metadata from rubygems.org..
Resolving dependencies...
Installing i18n (0.6.9)
Installing multi_json (1.8.4)
Installing activesupport (3.2.16)
Installing test-kitchen (1.0.0)
Installing kitchen-vagrant (0.11.3)
Using bundler (1.5.2)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
mkdir C:\kitchen\cookbooks && cd C:\kitchen\cookbooks && knife cookbook site download sendmail
C:\kitchen>kitchen init
create .kitchen.yml
create test/integration/default
create .gitignore
append .gitignore
append .gitignore
C:\kitchen>kitchen test
.....................
←[0m[2014-01-11T10:17:15+00:00] INFO: *** Chef 11.8.2 ***←[36m
←[0m[2014-01-11T10:17:15+00:00] INFO: Chef-client pid: 1169←[36m
←[0m[2014-01-11T10:17:16+00:00] INFO: Setting the run_list to ["recipe[sendmail]"] from JSON←[36m
←[0m[2014-01-11T10:17:16+00:00] INFO: Run List is [recipe[sendmail]]←[36m
←[0m[2014-01-11T10:17:16+00:00] INFO: Run List expands to [sendmail]←[36m
←[0m[2014-01-11T10:17:16+00:00] INFO: Starting Chef Run for default-ubuntu-1204←[36m
←[0m[2014-01-11T10:17:16+00:00] INFO: Running start handlers←[36m
←[0m[2014-01-11T10:17:16+00:00] INFO: Start handlers complete.←[36m
←[0mCompiling Cookbooks...←[0m←[36m
←[0mConverging 2 resources←[0m←[36m
←[0mRecipe: sendmail::default←[0m←[36m
←[0m * package[sendmail] action install←[0m[2014-01-11T10:17:16+00:00] INFO: Processing package[sendmail] action install(sendmail::default line 1)←[36m
←[0m←[32m←[36m
←[0m - install version 8.14.4-2ubuntu2 of package sendmail←[0m←[36m
←[0m←[0m←[36m
←[0m * service[sendmail] action enable←[0m[2014-01-11T10:17:27+00:00] INFO: Processing service[sendmail] action enable (sendmail::default line 6)←[36m
←[0m[2014-01-11T10:17:27+00:00] INFO: service[sendmail] enabled←[36m
←[0m←[32m←[36m
←[0m - enable service service[sendmail]←[0m←[36m
←[0m←[0m←[36m
←[0m * service[sendmail] action start←[0m[2014-01-11T10:17:27+00:00] INFO: Processing service[sendmail] action start (sendmail::default line 6)←[36m
←[0m (up to date)←[0m←[36m
←[0m[2014-01-11T10:17:27+00:00] INFO: Chef Run complete in 11.695990777 seconds←[36m
←[0m[2014-01-11T10:17:27+00:00] INFO: Running report handlers←[36m
←[0m[2014-01-11T10:17:27+00:00] INFO: Report handlers complete←[36m
←[0mChef Client finished, 2 resources updated←[0m←[36m
←[0m←[36m Finished converging <default-ubuntu-1204> (0m29.54s).
←[0m←[36m-----> Setting up <default-ubuntu-1204>
←[0m←[36m Finished setting up <default-ubuntu-1204> (0m0.00s).
←[0m←[36m-----> Verifying <default-ubuntu-1204>
←[0m←[36m Finished verifying <default-ubuntu-1204> (0m0.00s).
←[0m←[36m-----> Destroying <default-ubuntu-1204>
←[0m←[36m [kitchen::driver::vagrant command] BEGIN (vagrant destroy -f)
←[0m←[36m [default] Forcing shutdown of VM...
←[0m←[36m [default] Destroying VM and associated drives...
←[0m←[36m [kitchen::driver::vagrant command] END (0m0.00s)
←[0m←[36m Vagrant instance <default-ubuntu-1204> destroyed.
←[0m←[36m Finished destroying <default-ubuntu-1204> (0m4.85s).
←[0m←[36m Finished testing <default-ubuntu-1204> (1m16.33s).
←[0m-----> Kitchen is finished. (1m16.69s)
C:\kitchen>vagrant plugin install vagrant-berkshelf
Installing the 'vagrant-berkshelf' plugin. This can take a few minutes...
Installed the plugin 'vagrant-berkshelf (1.3.7)'!
C:\kitchen>berks init chef-cook
create chef-cook/Berksfile
create chef-cook/Thorfile
create chef-cook/.gitignore
run git init from "./chef-cook"
C:/Ruby193/bin/berks: No such file or directory - git init
create chef-cook/Gemfile
create .kitchen.yml
append Thorfile
create test/integration/default
append Gemfile
append Gemfile
You must run `bundle install' to fetch any new gems.
create chef-cook/Vagrantfile
Successfully initialized
cd C:\kitchen\chef-cook && bundle install
mkdir C:\kitchen\chef-cook\cookbooks && cd C:\kitchen\chef-cook\cookbooks && berks cookbook mytest
C:\kitchen\chef-cook\.kitchen.yml
---
suites:
- name: default
run_list: ["recipe[mytest]"]
attributes: {}
C:\kitchen\chef-cook>kitchen test
ERROR: Cookbook mytest not found. If you're loading mytest from another cookbook, make sure you configure the dependency in your metadata
cookbook 'mytest', :path => 'cookbooks/mytest'
include_recipe 'sendmail'
depends 'sendmail'
site :opscode
cookbook 'sendmail'
cookbook 'mytest', :path => 'cookbooks/mytest'
C:\kitchen\chef-cook>kitchen conerge
....
←[0m←[36m Resolving cookbook dependencies with Berkshelf...
←[0mInstalling sendmail (0.1.0) from site: 'http://cookbooks.opscode.com/api/v1/cookbooks'
Using mytest (0.1.0) at './cookbooks/mytest'
....
←[0m * package[sendmail] action install←[0m[2014-01-15T08:00:44+00:00] INFO: Processing package[sendmail] action install (sendmail::default line 1)←[
....
←[0mChef Client finished, 2 resources updated←[0m←[36m
←[0m←[36m Finished converging <default-ubuntu-1204> (0m18.25s).
←[0m-----> Kitchen is finished. (0m18.68s)
Source: https://habr.com/ru/post/209238/
All Articles