berkshelf 2.0.0.beta → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +19 -1
- data/CONTRIBUTING.md +1 -3
- data/Gemfile +0 -20
- data/Guardfile +3 -3
- data/LICENSE +6 -5
- data/README.md +1 -0
- data/Thorfile +48 -67
- data/berkshelf.gemspec +48 -37
- data/features/apply_command.feature +17 -11
- data/features/config.feature +11 -11
- data/features/configure_command.feature +8 -8
- data/features/contingent_command.feature +37 -8
- data/features/cookbook_command.feature +17 -14
- data/features/groups_install.feature +24 -20
- data/features/install_command.feature +24 -33
- data/features/licenses.feature +112 -0
- data/features/list_command.feature +17 -5
- data/features/lockfile.feature +307 -188
- data/features/outdated_command.feature +1 -4
- data/features/package_command.feature +41 -19
- data/features/shelf/list.feature +39 -0
- data/features/shelf/show.feature +152 -0
- data/features/shelf/uninstall.feature +103 -0
- data/features/show_command.feature +49 -17
- data/features/step_definitions/filesystem_steps.rb +12 -3
- data/features/step_definitions/utility_steps.rb +0 -1
- data/features/support/env.rb +11 -4
- data/features/update_command.feature +22 -10
- data/features/upload_command.feature +174 -127
- data/features/vendor_install.feature +6 -6
- data/generator_files/Berksfile.erb +1 -1
- data/generator_files/metadata.rb.erb +7 -7
- data/lib/berkshelf.rb +39 -27
- data/lib/berkshelf/base_generator.rb +2 -3
- data/lib/berkshelf/berksfile.rb +69 -17
- data/lib/berkshelf/cached_cookbook.rb +17 -1
- data/lib/berkshelf/chef.rb +2 -4
- data/lib/berkshelf/chef/config.rb +51 -75
- data/lib/berkshelf/chef/cookbook.rb +1 -2
- data/lib/berkshelf/chef/cookbook/chefignore.rb +1 -1
- data/lib/berkshelf/cli.rb +144 -194
- data/lib/berkshelf/command.rb +11 -12
- data/lib/berkshelf/commands/shelf.rb +130 -0
- data/lib/berkshelf/commands/test_command.rb +11 -0
- data/lib/berkshelf/community_rest.rb +1 -2
- data/lib/berkshelf/config.rb +14 -10
- data/lib/berkshelf/cookbook_generator.rb +30 -24
- data/lib/berkshelf/cookbook_source.rb +1 -1
- data/lib/berkshelf/cookbook_store.rb +0 -1
- data/lib/berkshelf/core_ext.rb +1 -1
- data/lib/berkshelf/core_ext/file.rb +1 -1
- data/lib/berkshelf/downloader.rb +3 -1
- data/lib/berkshelf/errors.rb +128 -53
- data/lib/berkshelf/formatters.rb +2 -6
- data/lib/berkshelf/formatters/human_readable.rb +8 -2
- data/lib/berkshelf/formatters/json.rb +7 -1
- data/lib/berkshelf/formatters/null.rb +0 -1
- data/lib/berkshelf/git.rb +16 -16
- data/lib/berkshelf/init_generator.rb +28 -26
- data/lib/berkshelf/location.rb +12 -11
- data/lib/berkshelf/locations/chef_api_location.rb +2 -2
- data/lib/berkshelf/locations/git_location.rb +0 -1
- data/lib/berkshelf/locations/github_location.rb +0 -1
- data/lib/berkshelf/locations/path_location.rb +1 -2
- data/lib/berkshelf/locations/site_location.rb +3 -2
- data/lib/berkshelf/lockfile.rb +29 -10
- data/lib/berkshelf/mixin/config.rb +155 -0
- data/lib/berkshelf/mixin/logging.rb +0 -1
- data/lib/berkshelf/mixin/shellout.rb +71 -0
- data/lib/berkshelf/resolver.rb +7 -4
- data/lib/berkshelf/test.rb +1 -3
- data/lib/berkshelf/ui.rb +8 -4
- data/lib/berkshelf/version.rb +1 -1
- data/lib/thor/monkies/shell.rb +0 -1
- data/spec/config/berkshelf.pem +27 -0
- data/spec/config/knife.rb +12 -0
- data/spec/config/validator.pem +27 -0
- data/spec/spec_helper.rb +4 -8
- data/spec/support/chef_api.rb +14 -9
- data/spec/support/chef_server.rb +3 -4
- data/spec/unit/berkshelf/berksfile_spec.rb +1 -1
- data/spec/unit/berkshelf/cookbook_generator_spec.rb +12 -6
- data/spec/unit/berkshelf/cookbook_source_spec.rb +13 -1
- data/spec/unit/berkshelf/init_generator_spec.rb +5 -0
- data/spec/unit/chef/config_spec.rb +9 -10
- metadata +216 -93
- data/features/info_command.feature +0 -39
- data/features/open_command.feature +0 -36
- data/lib/berkshelf/cli_commands/test_command.rb +0 -11
- data/lib/berkshelf/mixin.rb +0 -10
- data/lib/berkshelf/mixin/path_helpers.rb +0 -30
- data/spec/support/knife.rb +0 -18
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
# 2.0.0
|
2
|
+
|
3
|
+
* Huge improvements to the Lockfile
|
4
|
+
- They actually work!
|
5
|
+
- Now in JSON format
|
6
|
+
- Old lockfiles will automatically be converted to the new format
|
7
|
+
* Add `berks shelf` command. Any operations on the already installed cookbooks now reside here
|
8
|
+
- `berks shelf list` to list all cookbooks in the Berkshelf
|
9
|
+
- `berks shelf show` to display information about a specific cookbook in the Berkshelf
|
10
|
+
- `berks shelf uninstall` to remove an installed cookbook from the Berkshelf
|
11
|
+
* Add `berks package` command. Will package any cookbooks and dependencies defined in your Berksfile into a tar.
|
12
|
+
* Add `berks apply` command. Take the locked constraints of your lockfile and apply them directly to the an environment's locked cookbook versions.
|
13
|
+
* Test-Kitchen integration (beta)
|
14
|
+
- Add `berks test` command. This is a delegator to `bin/kitchen`
|
15
|
+
- Berkshelf's Cookbook generators will by default generate Test-Kitchen files for you
|
16
|
+
* Remove `berks open` command
|
17
|
+
* Rename `berks info` command to `berks show`
|
18
|
+
|
1
19
|
# 1.4.4
|
2
20
|
|
3
21
|
- Bump Ridley dependency to 0.12, bringing in many bugfixes.
|
@@ -29,7 +47,7 @@
|
|
29
47
|
|
30
48
|
# 1.3.1
|
31
49
|
- Support for Vagrant 1.1.x
|
32
|
-
- Move Berkshelf Vagrant plugin into it's [own repository](https://github.com/RiotGames/berkshelf
|
50
|
+
- Move Berkshelf Vagrant plugin into it's [own repository](https://github.com/RiotGames/vagrant-berkshelf)
|
33
51
|
- Added -d flag to output debug information in berks command
|
34
52
|
- Various bug fixes in uploading cookbooks
|
35
53
|
|
data/CONTRIBUTING.md
CHANGED
@@ -34,9 +34,7 @@ Bundler will install all gems and their dependencies required for testing and de
|
|
34
34
|
|
35
35
|
### Running unit (RSpec) and acceptance (Cucumber) tests
|
36
36
|
|
37
|
-
|
38
|
-
chef server. Berkshelf tests may upload and destroy cookbooks on your chef
|
39
|
-
server, so be sure to configure a server safe for this task.
|
37
|
+
We use Chef Zero - an in-memory Chef Server for running tests. It is automatically managed by the Specs and Cukes. Simply run:
|
40
38
|
|
41
39
|
$ bundle exec guard start
|
42
40
|
|
data/Gemfile
CHANGED
@@ -3,17 +3,6 @@ source 'https://rubygems.org'
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
group :development do
|
6
|
-
gem 'chef-zero', '>= 0.9.9'
|
7
|
-
gem 'coolline'
|
8
|
-
gem 'guard', '>= 1.5.0'
|
9
|
-
gem 'guard-cane'
|
10
|
-
gem 'guard-cucumber'
|
11
|
-
gem 'guard-rspec'
|
12
|
-
gem 'guard-spork'
|
13
|
-
gem 'guard-yard'
|
14
|
-
gem 'redcarpet'
|
15
|
-
gem 'yard'
|
16
|
-
|
17
6
|
require 'rbconfig'
|
18
7
|
|
19
8
|
if RbConfig::CONFIG['target_os'] =~ /darwin/i
|
@@ -34,12 +23,3 @@ group :development do
|
|
34
23
|
gem 'win32console', require: false
|
35
24
|
end
|
36
25
|
end
|
37
|
-
|
38
|
-
group :test do
|
39
|
-
gem 'fuubar'
|
40
|
-
gem 'json_spec'
|
41
|
-
gem 'rake', '>= 0.9.2.2'
|
42
|
-
gem 'rspec'
|
43
|
-
gem 'thor'
|
44
|
-
gem 'webmock'
|
45
|
-
end
|
data/Guardfile
CHANGED
@@ -10,13 +10,13 @@ guard 'yard', stdout: '/dev/null', stderr: '/dev/null' do
|
|
10
10
|
watch(%r{ext/.+\.c})
|
11
11
|
end
|
12
12
|
|
13
|
-
guard 'rspec', cli:
|
13
|
+
guard 'rspec', cli: '--color --drb --format Fuubar', all_on_start: false, all_after_pass: false do
|
14
14
|
watch(%r{^spec/unit/.+_spec\.rb$})
|
15
15
|
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
|
16
|
-
watch('spec/spec_helper.rb') {
|
16
|
+
watch('spec/spec_helper.rb') { 'spec' }
|
17
17
|
end
|
18
18
|
|
19
|
-
guard 'cucumber', cli:
|
19
|
+
guard 'cucumber', cli: '--drb --format pretty --tags ~@no_run --tags ~@wip', all_on_start: false, all_after_pass: false do
|
20
20
|
watch(%r{^features/.+\.feature$})
|
21
21
|
watch(%r{^features/support/.+$}) { 'features' }
|
22
22
|
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
|
data/LICENSE
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
|
2
|
-
Author:: Josiah Kiehl (<jkiehl@riotgames.com>)
|
3
|
-
Author:: Michael Ivey (<michael.ivey@riotgames.com>)
|
4
|
-
Author:: Justin Campbell (<justin.campbell@riotgames.com>)
|
1
|
+
Copyright 2012-2013 Riot Games
|
5
2
|
|
6
|
-
|
3
|
+
Jamie Winsor (<reset@riotgames.com>)
|
4
|
+
Josiah Kiehl (<jkiehl@riotgames.com>)
|
5
|
+
Michael Ivey (<michael.ivey@riotgames.com>)
|
6
|
+
Justin Campbell (<justin.campbell@riotgames.com>)
|
7
|
+
Seth Vargo (<sethvargo@gmail.com>)
|
7
8
|
|
8
9
|
Licensed under the Apache License, Version 2.0 (the "License");
|
9
10
|
you may not use this file except in compliance with the License.
|
data/README.md
CHANGED
@@ -79,6 +79,7 @@ Authors
|
|
79
79
|
- Josiah Kiehl (<jkiehl@riotgames.com>)
|
80
80
|
- Michael Ivey (<michael.ivey@riotgames.com>)
|
81
81
|
- Justin Campbell (<justin.campbell@riotgames.com>)
|
82
|
+
- Seth Vargo (<sethvargo@gmail.com>)
|
82
83
|
|
83
84
|
Thank you to all of our [Contributors](https://github.com/RiotGames/berkshelf/graphs/contributors), testers, and users.
|
84
85
|
|
data/Thorfile
CHANGED
@@ -1,89 +1,70 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
$:.
|
2
|
+
$:.unshift File.expand_path('../lib', __FILE__)
|
3
3
|
|
4
4
|
require 'bundler'
|
5
|
-
require 'bundler/setup'
|
6
|
-
|
7
|
-
require 'berkshelf'
|
8
5
|
require 'thor/rake_compat'
|
9
6
|
|
10
|
-
class
|
11
|
-
|
12
|
-
|
13
|
-
Bundler::GemHelper.install_tasks
|
14
|
-
|
15
|
-
namespace :gem
|
7
|
+
class Gem < Thor
|
8
|
+
include Thor::RakeCompat
|
9
|
+
Bundler::GemHelper.install_tasks
|
16
10
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
11
|
+
desc 'build', "Build berkshelf-#{Berkshelf::VERSION}.gem into the pkg directory"
|
12
|
+
def build
|
13
|
+
Rake::Task['build'].execute
|
14
|
+
end
|
21
15
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
desc 'install', "Build and install berkshelf-#{Berkshelf::VERSION}.gem into system gems"
|
17
|
+
def install
|
18
|
+
Rake::Task['install'].execute
|
19
|
+
end
|
26
20
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
21
|
+
desc 'release', "Create tag v#{Berkshelf::VERSION} and build and push berkshelf-#{Berkshelf::VERSION}.gem to Rubygems"
|
22
|
+
def release
|
23
|
+
Rake::Task['release'].execute
|
31
24
|
end
|
25
|
+
end
|
32
26
|
|
33
|
-
|
34
|
-
|
27
|
+
class Spec < Thor
|
28
|
+
include Thor::Actions
|
29
|
+
default_task :all
|
35
30
|
|
36
|
-
|
37
|
-
|
31
|
+
desc 'all', 'Run all specs and features'
|
32
|
+
def all
|
33
|
+
exit(units_command && acceptance_command && quality_command)
|
34
|
+
end
|
38
35
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
36
|
+
desc 'ci', 'Run tests on Travis'
|
37
|
+
def ci
|
38
|
+
ENV['CI'] = 'true' # Travis-CI also sets this, but set it here for local testing
|
39
|
+
all
|
40
|
+
end
|
45
41
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
exit 1
|
51
|
-
end
|
52
|
-
end
|
42
|
+
desc 'unit', 'Run unit tests'
|
43
|
+
def unit
|
44
|
+
exit(units_command)
|
45
|
+
end
|
53
46
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
end
|
59
|
-
end
|
47
|
+
desc 'acceptance', 'Run acceptance tests'
|
48
|
+
def acceptance
|
49
|
+
exit(acceptance_command)
|
50
|
+
end
|
60
51
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
end
|
66
|
-
end
|
52
|
+
desc 'quality', 'Run code quality tests'
|
53
|
+
def quality
|
54
|
+
exit(quality_command)
|
55
|
+
end
|
67
56
|
|
68
|
-
|
69
|
-
def
|
70
|
-
|
71
|
-
exit 1
|
72
|
-
end
|
57
|
+
no_tasks do
|
58
|
+
def units_command
|
59
|
+
run('rspec --color --format=documentation spec/unit')
|
73
60
|
end
|
74
61
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
end
|
79
|
-
|
80
|
-
def run_acceptance(*flags)
|
81
|
-
run "cucumber --color --format pretty --tags ~@no_run #{flags.join(' ')}"
|
82
|
-
end
|
62
|
+
def acceptance_command
|
63
|
+
run('cucumber --color --format pretty --tags ~@no_run')
|
64
|
+
end
|
83
65
|
|
84
|
-
|
85
|
-
|
86
|
-
end
|
66
|
+
def quality_command
|
67
|
+
run('cane --gte coverage/.last_run.json,90')
|
87
68
|
end
|
88
69
|
end
|
89
70
|
end
|
data/berkshelf.gemspec
CHANGED
@@ -3,53 +3,64 @@ require File.expand_path('../lib/berkshelf/version', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.authors = [
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
'Jamie Winsor',
|
7
|
+
'Josiah Kiehl',
|
8
|
+
'Michael Ivey',
|
9
|
+
'Justin Campbell',
|
10
|
+
'Seth Vargo'
|
10
11
|
]
|
11
12
|
s.email = [
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
'reset@riotgames.com',
|
14
|
+
'jkiehl@riotgames.com',
|
15
|
+
'michael.ivey@riotgames.com',
|
16
|
+
'justin.campbell@riotgames.com',
|
17
|
+
'sethvargo@gmail.com'
|
16
18
|
]
|
17
19
|
|
18
20
|
s.description = %q{Manages a Cookbook's, or an Application's, Cookbook dependencies}
|
19
21
|
s.summary = s.description
|
20
|
-
s.homepage =
|
21
|
-
s.license =
|
22
|
+
s.homepage = 'http://berkshelf.com'
|
23
|
+
s.license = 'Apache 2.0'
|
22
24
|
s.files = `git ls-files`.split($\)
|
23
25
|
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
24
26
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
25
|
-
s.name =
|
26
|
-
s.require_paths = [
|
27
|
+
s.name = 'berkshelf'
|
28
|
+
s.require_paths = ['lib']
|
27
29
|
s.version = Berkshelf::VERSION
|
28
|
-
s.required_ruby_version =
|
29
|
-
s.required_rubygems_version =
|
30
|
+
s.required_ruby_version = '>= 1.9.1'
|
31
|
+
s.required_rubygems_version = '>= 1.8.0'
|
30
32
|
|
31
|
-
s.add_dependency '
|
32
|
-
s.add_dependency '
|
33
|
-
s.add_dependency '
|
34
|
-
s.add_dependency '
|
35
|
-
s.add_dependency '
|
36
|
-
s.add_dependency '
|
37
|
-
s.add_dependency '
|
38
|
-
s.add_dependency '
|
39
|
-
s.add_dependency '
|
40
|
-
s.add_dependency '
|
41
|
-
s.add_dependency '
|
42
|
-
s.add_dependency 'thor',
|
43
|
-
s.add_dependency 'retryable'
|
44
|
-
s.add_dependency 'addressable'
|
33
|
+
s.add_dependency 'activesupport', '>= 3.2.0'
|
34
|
+
s.add_dependency 'addressable', '~> 2.3.4'
|
35
|
+
s.add_dependency 'celluloid', '>= 0.14.0'
|
36
|
+
s.add_dependency 'chozo', '>= 0.6.1'
|
37
|
+
s.add_dependency 'faraday', '>= 0.8.5'
|
38
|
+
s.add_dependency 'hashie', '>= 2.0.2'
|
39
|
+
s.add_dependency 'minitar', '~> 0.5.4'
|
40
|
+
s.add_dependency 'retryable', '~> 1.3.3'
|
41
|
+
s.add_dependency 'ridley', '~> 1.0.0'
|
42
|
+
s.add_dependency 'solve', '>= 0.4.4'
|
43
|
+
s.add_dependency 'test-kitchen', '>= 1.0.0.alpha7'
|
44
|
+
s.add_dependency 'thor', '~> 0.18.0'
|
45
45
|
|
46
|
-
s.add_development_dependency 'aruba'
|
47
|
-
s.add_development_dependency 'cane'
|
48
|
-
s.add_development_dependency '
|
49
|
-
s.add_development_dependency '
|
50
|
-
s.add_development_dependency '
|
51
|
-
s.add_development_dependency '
|
52
|
-
s.add_development_dependency '
|
53
|
-
s.add_development_dependency '
|
54
|
-
s.add_development_dependency 'vcr',
|
46
|
+
s.add_development_dependency 'aruba', '~> 0.5'
|
47
|
+
s.add_development_dependency 'cane', '~> 2.5'
|
48
|
+
s.add_development_dependency 'chef-zero', '~> 1.1'
|
49
|
+
s.add_development_dependency 'fuubar', '~> 1.1'
|
50
|
+
s.add_development_dependency 'rake', '~> 0.9'
|
51
|
+
s.add_development_dependency 'rspec', '~> 2.13'
|
52
|
+
s.add_development_dependency 'simplecov', '~> 0.7'
|
53
|
+
s.add_development_dependency 'spork', '~> 0.9'
|
54
|
+
s.add_development_dependency 'vcr', '~> 2.4'
|
55
|
+
s.add_development_dependency 'webmock', '~> 1.11'
|
56
|
+
s.add_development_dependency 'yard', '~> 0.8'
|
57
|
+
|
58
|
+
# Guard extensions for development
|
59
|
+
s.add_development_dependency 'coolline', '~> 0.4.2' # readline for guard on MRI
|
60
|
+
s.add_development_dependency 'guard', '~> 1.8'
|
61
|
+
s.add_development_dependency 'guard-cane'
|
62
|
+
s.add_development_dependency 'guard-cucumber'
|
63
|
+
s.add_development_dependency 'guard-rspec'
|
64
|
+
s.add_development_dependency 'guard-spork'
|
65
|
+
s.add_development_dependency 'guard-yard'
|
55
66
|
end
|
@@ -1,32 +1,38 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: Applying cookbook versions to a Chef Environment
|
2
2
|
As a berks user
|
3
3
|
I want to push my berks resolved cookbook versions to my environment
|
4
4
|
So that I can avoid manual configuration of my environments
|
5
5
|
|
6
6
|
@chef_server
|
7
|
-
Scenario:
|
8
|
-
Given
|
7
|
+
Scenario: Locking a cookbook version with dependencies
|
8
|
+
Given the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
|
9
|
+
| dependency | 2.0.0 |
|
10
|
+
And the cookbook store has the cookbooks:
|
11
|
+
| dependency | 2.0.0 |
|
12
|
+
And I have an environment named "berkshelf_lock_test"
|
9
13
|
And I write to "Berksfile" with:
|
10
14
|
"""
|
11
|
-
cookbook '
|
15
|
+
cookbook 'fake', '1.0.0'
|
12
16
|
"""
|
13
|
-
When I successfully run
|
17
|
+
When I successfully run `berks apply berkshelf_lock_test`
|
14
18
|
Then the version locks in "berkshelf_lock_test" should be:
|
15
|
-
|
16
|
-
|
17
|
-
|
19
|
+
| cookbook | version_lock |
|
20
|
+
| fake | 1.0.0 |
|
21
|
+
| dependency | 2.0.0 |
|
18
22
|
And the exit status should be 0
|
19
23
|
|
20
24
|
@chef_server
|
21
|
-
Scenario:
|
25
|
+
Scenario: Locking cookbook versions to a non-existent Chef Environment
|
22
26
|
Given I do not have an environment named "berkshelf_lock_test"
|
27
|
+
And the cookbook store has the cookbooks:
|
28
|
+
| fake | 1.0.0 |
|
23
29
|
And I write to "Berksfile" with:
|
24
30
|
"""
|
25
|
-
cookbook '
|
31
|
+
cookbook 'fake', '1.0.0'
|
26
32
|
"""
|
27
33
|
When I run the apply command on "berkshelf_lock_test"
|
28
34
|
Then the output should contain:
|
29
35
|
"""
|
30
|
-
The environment
|
36
|
+
The environment 'berkshelf_lock_test' does not exist
|
31
37
|
"""
|
32
38
|
And the CLI should exit with the status code for error "EnvironmentNotFound"
|
data/features/config.feature
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: Reading a Berkshelf configuration file
|
2
2
|
As a Cookbook author
|
3
3
|
I want to quickly generate a cookbook with my own customizations
|
4
4
|
So that I don't have to spend time modifying the default generated output each time
|
5
5
|
|
6
|
-
Scenario:
|
6
|
+
Scenario: Missing a Berkshelf configuration file
|
7
7
|
Given I do not have a Berkshelf config file
|
8
|
-
When I run
|
8
|
+
When I successfully run `berks cookbook sparkle_motion`
|
9
9
|
Then the resulting "sparkle_motion" Vagrantfile should contain:
|
10
10
|
| config.vm.box = "Berkshelf-CentOS-6.3-x86_64-minimal" |
|
11
11
|
| config.vm.box_url = "https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86_64-minimal.box" |
|
12
12
|
And the exit status should be 0
|
13
13
|
|
14
|
-
Scenario:
|
14
|
+
Scenario: Using a Berkshelf configuration file
|
15
15
|
Given I have a Berkshelf config file containing:
|
16
16
|
"""
|
17
17
|
{
|
@@ -30,7 +30,7 @@ Feature: cookbook creation with a config file
|
|
30
30
|
}
|
31
31
|
}
|
32
32
|
"""
|
33
|
-
When I run
|
33
|
+
When I successfully run `berks cookbook sparkle_motion`
|
34
34
|
Then the resulting "sparkle_motion" Vagrantfile should contain:
|
35
35
|
| config.vm.box = "my_box" |
|
36
36
|
| config.vm.box_url = "http://files.vagrantup.com/lucid64.box" |
|
@@ -39,7 +39,7 @@ Feature: cookbook creation with a config file
|
|
39
39
|
| config.vm.network :public_network |
|
40
40
|
And the exit status should be 0
|
41
41
|
|
42
|
-
Scenario:
|
42
|
+
Scenario: Using a partial Berkshelf configuration file
|
43
43
|
Given I have a Berkshelf config file containing:
|
44
44
|
"""
|
45
45
|
{
|
@@ -52,12 +52,12 @@ Feature: cookbook creation with a config file
|
|
52
52
|
}
|
53
53
|
}
|
54
54
|
"""
|
55
|
-
When I run
|
55
|
+
When I successfully run `berks cookbook sparkle_motion`
|
56
56
|
Then the resulting "sparkle_motion" Vagrantfile should contain:
|
57
57
|
| config.vm.network :forwarded_port, guest: 12345, host: 54321 |
|
58
58
|
And the exit status should be 0
|
59
59
|
|
60
|
-
Scenario:
|
60
|
+
Scenario: Using an invalid Berkshelf configuration file
|
61
61
|
Given I have a Berkshelf config file containing:
|
62
62
|
"""
|
63
63
|
{
|
@@ -68,12 +68,12 @@ Feature: cookbook creation with a config file
|
|
68
68
|
}
|
69
69
|
}
|
70
70
|
"""
|
71
|
-
When I run
|
71
|
+
When I run `berks cookbook sparkle_motion`
|
72
72
|
Then the output should contain "Invalid configuration"
|
73
73
|
And the output should contain "vagrant.vm.box Expected attribute: 'vagrant.vm.box' to be a type of: 'String'"
|
74
74
|
And the CLI should exit with the status code for error "InvalidConfiguration"
|
75
75
|
|
76
|
-
Scenario:
|
76
|
+
Scenario: Using a Berkshelf configuration file with Chef configuration information
|
77
77
|
Given I have a Berkshelf config file containing:
|
78
78
|
"""
|
79
79
|
{
|
@@ -89,7 +89,7 @@ Feature: cookbook creation with a config file
|
|
89
89
|
}
|
90
90
|
}
|
91
91
|
"""
|
92
|
-
When I run
|
92
|
+
When I successfully run `berks cookbook sparkle_motion`
|
93
93
|
Then the resulting "sparkle_motion" Vagrantfile should contain:
|
94
94
|
| config.vm.provision :chef_client |
|
95
95
|
| chef.chef_server_url = "localhost:4000" |
|