berkshelf 1.1.6 → 1.2.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.cane +4 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +25 -0
- data/CONTRIBUTING.md +9 -0
- data/Gemfile +1 -7
- data/Guardfile +4 -2
- data/LICENSE +4 -4
- data/README.md +34 -11
- data/Thorfile +12 -11
- data/berkshelf-complete.sh +68 -0
- data/berkshelf.gemspec +23 -10
- data/bin/berks +2 -0
- data/features/config.feature +5 -4
- data/features/configure_command.feature +1 -0
- data/features/install_command.feature +7 -43
- data/features/step_definitions/configure_cli_steps.rb +6 -0
- data/features/step_definitions/filesystem_steps.rb +3 -1
- data/features/step_definitions/json_steps.rb +7 -0
- data/features/support/env.rb +3 -8
- data/features/upload_command.feature +49 -101
- data/generator_files/Vagrantfile.erb +1 -1
- data/generator_files/gitignore.erb +6 -1
- data/lib/berkshelf.rb +17 -26
- data/lib/berkshelf/base_generator.rb +8 -7
- data/lib/berkshelf/berksfile.rb +33 -13
- data/lib/berkshelf/cached_cookbook.rb +16 -37
- data/lib/berkshelf/chef.rb +11 -0
- data/lib/berkshelf/chef/config.rb +93 -0
- data/lib/berkshelf/chef/cookbook.rb +8 -0
- data/lib/berkshelf/chef/cookbook/chefignore.rb +60 -0
- data/lib/berkshelf/chef/cookbook/metadata.rb +556 -0
- data/lib/berkshelf/chef/cookbook/syntax_check.rb +158 -0
- data/lib/berkshelf/chef/digester.rb +67 -0
- data/lib/berkshelf/cli.rb +18 -4
- data/lib/berkshelf/command.rb +117 -0
- data/lib/berkshelf/community_rest.rb +135 -0
- data/lib/berkshelf/config.rb +16 -50
- data/lib/berkshelf/cookbook_generator.rb +5 -9
- data/lib/berkshelf/cookbook_source.rb +1 -1
- data/lib/berkshelf/cookbook_store.rb +5 -1
- data/lib/berkshelf/downloader.rb +4 -4
- data/lib/berkshelf/errors.rb +6 -0
- data/lib/berkshelf/formatters.rb +3 -3
- data/lib/berkshelf/formatters/human_readable.rb +1 -1
- data/lib/berkshelf/formatters/json.rb +1 -1
- data/lib/berkshelf/git.rb +2 -2
- data/lib/berkshelf/init_generator.rb +5 -11
- data/lib/berkshelf/location.rb +7 -6
- data/lib/berkshelf/locations/chef_api_location.rb +54 -108
- data/lib/berkshelf/locations/git_location.rb +1 -1
- data/lib/berkshelf/locations/github_location.rb +1 -1
- data/lib/berkshelf/locations/path_location.rb +22 -3
- data/lib/berkshelf/locations/site_location.rb +31 -99
- data/lib/berkshelf/mixin.rb +10 -0
- data/lib/berkshelf/mixin/checksum.rb +16 -0
- data/lib/berkshelf/mixin/params_validate.rb +218 -0
- data/lib/berkshelf/mixin/path_helpers.rb +30 -0
- data/lib/berkshelf/mixin/shell_out.rb +23 -0
- data/lib/berkshelf/resolver.rb +5 -3
- data/lib/berkshelf/ui.rb +5 -1
- data/lib/berkshelf/uploader.rb +11 -5
- data/lib/berkshelf/vagrant.rb +1 -1
- data/lib/berkshelf/vagrant/action/clean.rb +1 -1
- data/lib/berkshelf/vagrant/action/install.rb +1 -1
- data/lib/berkshelf/vagrant/action/set_ui.rb +2 -2
- data/lib/berkshelf/vagrant/action/upload.rb +1 -1
- data/lib/berkshelf/vagrant/action/validate.rb +1 -1
- data/lib/berkshelf/vagrant/config.rb +1 -1
- data/lib/berkshelf/vagrant/middleware.rb +1 -1
- data/lib/berkshelf/version.rb +1 -1
- data/lib/thor/monkies/shell.rb +8 -0
- data/spec/fixtures/cookbooks/example_cookbook-0.5.0/metadata.rb +1 -1
- data/spec/fixtures/cookbooks/example_cookbook/metadata.rb +1 -1
- data/spec/fixtures/cookbooks/nginx-0.100.5/templates/default/plugins/nginx.rb.erb +1 -1
- data/spec/spec_helper.rb +81 -21
- data/spec/support/chef_api.rb +29 -28
- data/spec/support/knife.rb +2 -2
- data/spec/support/test_generators.rb +27 -0
- data/spec/unit/berkshelf/berksfile_spec.rb +2 -2
- data/spec/unit/berkshelf/cached_cookbook_spec.rb +10 -2
- data/spec/unit/berkshelf/community_rest_spec.rb +120 -0
- data/spec/unit/berkshelf/config_spec.rb +0 -12
- data/spec/unit/berkshelf/cookbook_generator_spec.rb +65 -67
- data/spec/unit/berkshelf/cookbook_source_spec.rb +1 -1
- data/spec/unit/berkshelf/git_spec.rb +17 -12
- data/spec/unit/berkshelf/init_generator_spec.rb +126 -120
- data/spec/unit/berkshelf/location_spec.rb +2 -2
- data/spec/unit/berkshelf/locations/chef_api_location_spec.rb +90 -186
- data/spec/unit/berkshelf/locations/git_location_spec.rb +87 -82
- data/spec/unit/berkshelf/locations/path_location_spec.rb +34 -35
- data/spec/unit/berkshelf/locations/site_location_spec.rb +12 -115
- data/spec/unit/berkshelf/resolver_spec.rb +96 -87
- data/spec/unit/berkshelf/ui_spec.rb +132 -0
- data/spec/unit/berkshelf/uploader_spec.rb +18 -12
- data/spec/unit/chef/config_spec.rb +9 -0
- data/spec/unit/chef/cookbook/metadata_spec.rb +5 -0
- data/spec/unit/chef/digester_spec.rb +41 -0
- metadata +263 -28
data/.cane
ADDED
data/.gitignore
CHANGED
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 1.1.0
|
|
2
|
+
## new/improved commands
|
|
3
|
+
- `berks show` command: display the file path for the given cookbook's current version resolved by your Berksfile
|
|
4
|
+
- `berks list` command: list all of the cookbooks and their versions that are installed by resolving your Berksfile
|
|
5
|
+
- `berks outdated` command (beta): show any cookbooks which have newer versions that are installed by resolving your Berksfile
|
|
6
|
+
- `berks open` command [alpha]: like `berks show` except used to open the cookbook in your configured editor
|
|
7
|
+
alpha: use at your own risk
|
|
8
|
+
- improved `berks upload` command: now takes an optional cookbook name, or names, which will upload the target cookbook(s) to the Chef Server
|
|
9
|
+
- improved `berks update` command: now takes an optional cookbook name, or names, which will update the target cookbook(s) in the Berksfile.lock
|
|
10
|
+
|
|
11
|
+
## bug fixes
|
|
12
|
+
- Improved error output in Vagrant plugin
|
|
13
|
+
- Stack traces will now be replaced by friendly error messages where possible
|
|
14
|
+
- Fix init generator on Ruby 1.9.2
|
|
15
|
+
- Honor 'chefignore' when vendoring cookbooks this will ensure that you aren't putting junk files into your cookbooks if your distributing them for use with Chef-Solo
|
|
16
|
+
|
|
17
|
+
# 1.0.0
|
|
18
|
+
- Windows support
|
|
19
|
+
- Easier installation by dropping Gecode requirement
|
|
20
|
+
- Vagrant plugin for a seamless iteration process
|
|
21
|
+
- Berkshelf has it's own configuration file
|
|
22
|
+
- `berks configure` command
|
|
23
|
+
- Github source location
|
|
24
|
+
- Improved upload/download speed of cookbooks
|
|
25
|
+
- Lots of bug fixes
|
data/CONTRIBUTING.md
CHANGED
|
@@ -42,3 +42,12 @@ server, so be sure to configure a server safe for this task.
|
|
|
42
42
|
|
|
43
43
|
See [here](https://github.com/tdegrunt/vagrant-chef-server-bootstrap) for a
|
|
44
44
|
quick way to get a testing chef server up.
|
|
45
|
+
|
|
46
|
+
### Debugging Issues
|
|
47
|
+
By default, Berkshelf will only give you the top-level output from a failed command. If you're working deep inside the core, an error like:
|
|
48
|
+
|
|
49
|
+
Berkshelf Error: wrong number of arguments (2 for 1)
|
|
50
|
+
|
|
51
|
+
isn't exactly helpful...
|
|
52
|
+
|
|
53
|
+
Specify the `BERKSHELF_DEBUG` flag when running your command to see a full stack trace and other helpful debugging information.
|
data/Gemfile
CHANGED
|
@@ -5,12 +5,12 @@ gemspec
|
|
|
5
5
|
group :development do
|
|
6
6
|
gem 'coolline'
|
|
7
7
|
gem 'guard', '>= 1.5.0'
|
|
8
|
+
gem 'guard-cane'
|
|
8
9
|
gem 'guard-cucumber'
|
|
9
10
|
gem 'guard-rspec'
|
|
10
11
|
gem 'guard-spork'
|
|
11
12
|
gem 'guard-yard'
|
|
12
13
|
gem 'redcarpet'
|
|
13
|
-
gem 'spork'
|
|
14
14
|
gem 'yard'
|
|
15
15
|
|
|
16
16
|
require 'rbconfig'
|
|
@@ -35,16 +35,10 @@ group :development do
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
group :test do
|
|
38
|
-
gem 'aruba'
|
|
39
38
|
gem 'fuubar'
|
|
40
39
|
gem 'json_spec'
|
|
41
40
|
gem 'rake', '>= 0.9.2.2'
|
|
42
41
|
gem 'rspec'
|
|
43
42
|
gem 'thor'
|
|
44
|
-
gem 'vcr'
|
|
45
43
|
gem 'webmock'
|
|
46
44
|
end
|
|
47
|
-
|
|
48
|
-
group :development, :test do
|
|
49
|
-
gem 'vagrant', '~> 1.0.6'
|
|
50
|
-
end
|
data/Guardfile
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
notification :off
|
|
2
|
-
|
|
3
1
|
guard 'spork' do
|
|
4
2
|
watch('Gemfile')
|
|
5
3
|
watch('spec/spec_helper.rb') { :rspec }
|
|
@@ -25,3 +23,7 @@ guard 'cucumber', cli: "--drb --format pretty --tags ~@no_run --tags ~@wip", all
|
|
|
25
23
|
|
|
26
24
|
watch(%r{^lib/berkshelf/cli.rb}) { 'features' }
|
|
27
25
|
end
|
|
26
|
+
|
|
27
|
+
guard 'cane', run_all_on_start: false do
|
|
28
|
+
watch(/.*\.rb/)
|
|
29
|
+
end
|
data/LICENSE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Author:: Jamie Winsor (<
|
|
2
|
-
Author:: Josiah Kiehl (<
|
|
3
|
-
Author:: Michael Ivey (<ivey@
|
|
4
|
-
Author:: Justin Campbell (<justin@
|
|
1
|
+
Author:: Jamie Winsor (<reset@riotgames.com>)
|
|
2
|
+
Author:: Josiah Kiehl (<jkiehl@riotgames.com>)
|
|
3
|
+
Author:: Michael Ivey (<michael.ivey@riotgames.com>)
|
|
4
|
+
Author:: Justin Campbell (<justin.campbell@riotgames.com>)
|
|
5
5
|
|
|
6
6
|
Copyright 2012 Riot Games
|
|
7
7
|
|
data/README.md
CHANGED
|
@@ -1,23 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
[](https://travis-ci.org/RiotGames/berkshelf)
|
|
4
|
+
[](https://codeclimate.com/github/RiotGames/berkshelf)
|
|
4
5
|
|
|
5
6
|
Manage a Cookbook or an Application's Cookbook dependencies
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Installation
|
|
9
|
+
------------
|
|
10
|
+
Add Berkshelf to your repository's `Gemfile`:
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
```ruby
|
|
13
|
+
gem 'berkshelf'
|
|
14
|
+
```
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
Or run it as a standalone:
|
|
12
17
|
|
|
18
|
+
gem install berkshelf
|
|
19
|
+
|
|
20
|
+
Usage
|
|
21
|
+
-----
|
|
13
22
|
See [berkshelf.com](http://berkshelf.com) for up-to-date usage instructions.
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+
Bash Completion
|
|
25
|
+
---------------
|
|
26
|
+
There is a [berkshelf bash completion script](https://raw.github.com/RiotGames/berkshelf/master/berkshelf-complete.sh). If you're using homebrew, you can install it like this:
|
|
27
|
+
|
|
28
|
+
brew install bash-completion # if you haven't already
|
|
29
|
+
|
|
30
|
+
Download the latest script
|
|
31
|
+
|
|
32
|
+
cd `brew --prefix`/etc/bash_completion && wget https://raw.github.com/RiotGames/berkshelf/master/berkshelf-complete.sh
|
|
33
|
+
|
|
34
|
+
And make sure you have this in your bash/zsh profile:
|
|
35
|
+
|
|
36
|
+
[ -f `brew --prefix`/etc/bash_completion ] && source `brew --prefix`/etc/bash_completion
|
|
16
37
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
38
|
+
Authors
|
|
39
|
+
-------
|
|
40
|
+
- Jamie Winsor (<reset@riotgames.com>)
|
|
41
|
+
- Josiah Kiehl (<jkiehl@riotgames.com>)
|
|
42
|
+
- Michael Ivey (<michael.ivey@riotgames.com>)
|
|
43
|
+
- Justin Campbell (<justin.campbell@riotgames.com>)
|
|
21
44
|
|
|
22
45
|
Thank you to all of our [Contributors](https://github.com/RiotGames/berkshelf/graphs/contributors), testers, and users.
|
|
23
46
|
|
data/Thorfile
CHANGED
|
@@ -38,7 +38,7 @@ class Default < Thor
|
|
|
38
38
|
|
|
39
39
|
desc "all", "Run all tests"
|
|
40
40
|
def all
|
|
41
|
-
unless run_unit && run_acceptance
|
|
41
|
+
unless run_unit && run_acceptance && run_quality
|
|
42
42
|
exit 1
|
|
43
43
|
end
|
|
44
44
|
end
|
|
@@ -46,7 +46,7 @@ class Default < Thor
|
|
|
46
46
|
desc "ci", "Run all possible tests on Travis-CI"
|
|
47
47
|
def ci
|
|
48
48
|
ENV['CI'] = 'true' # Travis-CI also sets this, but set it here for local testing
|
|
49
|
-
unless run_unit("--tag ~chef_server") && run_acceptance("--tags ~@chef_server")
|
|
49
|
+
unless run_unit("--tag ~chef_server") && run_acceptance("--tags ~@chef_server") && run_quality
|
|
50
50
|
exit 1
|
|
51
51
|
end
|
|
52
52
|
end
|
|
@@ -65,6 +65,13 @@ class Default < Thor
|
|
|
65
65
|
end
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
+
desc "quality", "Run quality tests"
|
|
69
|
+
def quality
|
|
70
|
+
unless run_quality
|
|
71
|
+
exit 1
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
68
75
|
no_tasks do
|
|
69
76
|
def run_unit(*flags)
|
|
70
77
|
run "rspec --color --format=documentation #{flags.join(' ')} spec"
|
|
@@ -73,16 +80,10 @@ class Default < Thor
|
|
|
73
80
|
def run_acceptance(*flags)
|
|
74
81
|
run "cucumber --color --format pretty --tags ~@no_run #{flags.join(' ')}"
|
|
75
82
|
end
|
|
76
|
-
end
|
|
77
|
-
end
|
|
78
83
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
desc "clean", "clean VCR cassettes"
|
|
84
|
-
def clean
|
|
85
|
-
FileUtils.rm_rf("spec/fixtures/vcr_cassettes")
|
|
84
|
+
def run_quality
|
|
85
|
+
run "cane --gte coverage/.last_run.json,90"
|
|
86
|
+
end
|
|
86
87
|
end
|
|
87
88
|
end
|
|
88
89
|
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Description
|
|
4
|
+
# Add tab completion for berkshelf
|
|
5
|
+
#
|
|
6
|
+
# Configuration:
|
|
7
|
+
# BERKSHELF_BERKSFILE (default is 'Berksfile')
|
|
8
|
+
#
|
|
9
|
+
# Notes:
|
|
10
|
+
# Must be added to your ~/.bashrc, ~/.zshrc, etc
|
|
11
|
+
#
|
|
12
|
+
# Author:
|
|
13
|
+
# Seth Vargo <sethvargo@gmail.com>
|
|
14
|
+
#
|
|
15
|
+
# License:
|
|
16
|
+
# Apache 2.0
|
|
17
|
+
#
|
|
18
|
+
|
|
19
|
+
_bundler() {
|
|
20
|
+
which bundle > /dev/null 2>&1 && [ -f "$(pwd)/Gemfile" ]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# Overwrite berks to use bundler if defined
|
|
24
|
+
_berks() {
|
|
25
|
+
[ _bundler ] && bundle exec berks $@ || berks $@
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
_berkshelf_commands() {
|
|
29
|
+
local cachefile=~/.berkshelf/.commands
|
|
30
|
+
[ ! -f $cachefile ] && $(_berks help | grep berks | cut -d " " -f 4 > $cachefile)
|
|
31
|
+
cat $cachefile
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_berkshelf_cookbooks() {
|
|
35
|
+
[ -z $BERKSHELF_BERKSFILE ] && BERKSHELF_BERKSFILE="Berksfile"
|
|
36
|
+
cat $BERKSHELF_BERKSFILE | grep "cookbook" | cut -d "'" -f 2
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
_local_cookbooks() {
|
|
40
|
+
ls -d cookbooks/*/ | cut -d "/" -f 2
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
_berkshelf() {
|
|
44
|
+
# local curr prev commands
|
|
45
|
+
COMPREPLY=()
|
|
46
|
+
curr="${COMP_WORDS[COMP_CWORD]}"
|
|
47
|
+
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
48
|
+
|
|
49
|
+
# List of commands to complete
|
|
50
|
+
commands=`_berkshelf_commands`
|
|
51
|
+
|
|
52
|
+
case "${prev}" in
|
|
53
|
+
"open"|"outdated"|"show"|"update"|"upload")
|
|
54
|
+
local berkshelf_cookbooks=`_berkshelf_cookbooks`
|
|
55
|
+
local local_cookbooks=`_local_cookbooks`
|
|
56
|
+
local cookbooks=`echo $berkshelf_cookbooks $local_cookbooks | sort -n | uniq`
|
|
57
|
+
COMPREPLY=($(compgen -W "${cookbooks}" -- ${curr}))
|
|
58
|
+
return 0
|
|
59
|
+
;;
|
|
60
|
+
*)
|
|
61
|
+
;;
|
|
62
|
+
esac
|
|
63
|
+
|
|
64
|
+
COMPREPLY=($(compgen -W "${commands}" -- ${curr}))
|
|
65
|
+
return 0
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
complete -F _berkshelf berks
|
data/berkshelf.gemspec
CHANGED
|
@@ -9,10 +9,10 @@ Gem::Specification.new do |s|
|
|
|
9
9
|
"Justin Campbell"
|
|
10
10
|
]
|
|
11
11
|
s.email = [
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"ivey@
|
|
15
|
-
"justin@
|
|
12
|
+
"reset@riotgames.com",
|
|
13
|
+
"jkiehl@riotgames.com",
|
|
14
|
+
"michael.ivey@riotgames.com",
|
|
15
|
+
"justin.campbell@riotgames.com"
|
|
16
16
|
]
|
|
17
17
|
|
|
18
18
|
s.description = %q{Manages a Cookbook's, or an Application's, Cookbook dependencies}
|
|
@@ -29,17 +29,30 @@ Gem::Specification.new do |s|
|
|
|
29
29
|
|
|
30
30
|
s.add_dependency 'yajl-ruby'
|
|
31
31
|
s.add_dependency 'activesupport'
|
|
32
|
-
|
|
33
|
-
s.add_dependency '
|
|
34
|
-
s.add_dependency '
|
|
35
|
-
s.add_dependency '
|
|
32
|
+
s.add_dependency 'mixlib-shellout'
|
|
33
|
+
s.add_dependency 'mixlib-config'
|
|
34
|
+
s.add_dependency 'faraday', '>= 0.8.5'
|
|
35
|
+
s.add_dependency 'ridley', '>= 0.7.0.rc4'
|
|
36
|
+
s.add_dependency 'chozo', '>= 0.5.0'
|
|
36
37
|
s.add_dependency 'hashie'
|
|
37
38
|
s.add_dependency 'minitar'
|
|
38
|
-
s.add_dependency '
|
|
39
|
-
s.add_dependency '
|
|
39
|
+
s.add_dependency 'json', '>= 1.5.0'
|
|
40
|
+
s.add_dependency 'multi_json', '~> 1.5'
|
|
41
|
+
s.add_dependency 'solve', '>= 0.4.2'
|
|
40
42
|
s.add_dependency 'thor', '~> 0.16.0'
|
|
41
43
|
|
|
42
44
|
# Vagrant 1-0-stable compatability locks
|
|
43
45
|
s.add_dependency 'moneta', '~> 0.6.0'
|
|
44
46
|
s.add_dependency 'net-ssh-gateway', '= 1.1.0'
|
|
47
|
+
|
|
48
|
+
s.add_development_dependency 'aruba'
|
|
49
|
+
s.add_development_dependency 'cane'
|
|
50
|
+
s.add_development_dependency 'json_spec'
|
|
51
|
+
s.add_development_dependency 'rake', '>= 0.9.2.2'
|
|
52
|
+
s.add_development_dependency 'rspec'
|
|
53
|
+
s.add_development_dependency 'simplecov'
|
|
54
|
+
s.add_development_dependency 'spork'
|
|
55
|
+
s.add_development_dependency 'thor'
|
|
56
|
+
s.add_development_dependency 'webmock'
|
|
57
|
+
s.add_development_dependency 'vagrant', '~> 1.0.6'
|
|
45
58
|
end
|
data/bin/berks
CHANGED
|
@@ -6,8 +6,10 @@ begin
|
|
|
6
6
|
Berkshelf::Cli.start
|
|
7
7
|
rescue Berkshelf::BerkshelfError => e
|
|
8
8
|
Berkshelf.ui.error e
|
|
9
|
+
Berkshelf.ui.error "\t" + e.backtrace.join("\n\t") if ENV['BERKSHELF_DEBUG']
|
|
9
10
|
exit e.status_code
|
|
10
11
|
rescue Ridley::Errors::RidleyError => e
|
|
11
12
|
Berkshelf.ui.error "#{e.class} #{e}"
|
|
13
|
+
Berkshelf.ui.error "\t" + e.backtrace.join("\n\t") if ENV['BERKSHELF_DEBUG']
|
|
12
14
|
exit 47
|
|
13
15
|
end
|
data/features/config.feature
CHANGED
|
@@ -61,15 +61,16 @@ Feature: cookbook creation with a config file
|
|
|
61
61
|
Given I have a Berkshelf config file containing:
|
|
62
62
|
"""
|
|
63
63
|
{
|
|
64
|
-
"vagrant":
|
|
64
|
+
"vagrant": {
|
|
65
|
+
"vm": {
|
|
66
|
+
"box": 1
|
|
67
|
+
}
|
|
68
|
+
}
|
|
65
69
|
}
|
|
66
70
|
"""
|
|
67
71
|
When I run the cookbook command to create "sparkle_motion"
|
|
68
72
|
Then the output should contain "Invalid configuration"
|
|
69
73
|
And the output should contain "vagrant.vm.box Expected attribute: 'vagrant.vm.box' to be a type of: 'String'"
|
|
70
|
-
And the output should contain "vagrant.vm.box A value is required for attribute: 'vagrant.vm.box'"
|
|
71
|
-
And the output should contain "vagrant.vm.box_url Expected attribute: 'vagrant.vm.box_url' to be a type of: 'String'"
|
|
72
|
-
And the output should contain "vagrant.vm.box_url A value is required for attribute: 'vagrant.vm.box_url'"
|
|
73
74
|
And the CLI should exit with the status code for error "InvalidConfiguration"
|
|
74
75
|
|
|
75
76
|
Scenario: creating a new cookbook with a chef client config
|
|
@@ -242,9 +242,9 @@ Feature: install cookbooks from a Berksfile
|
|
|
242
242
|
When I run `berks install`
|
|
243
243
|
Then the output should contain:
|
|
244
244
|
"""
|
|
245
|
-
|
|
245
|
+
Cookbook downloaded for 'artifact' from git: 'git://github.com/RiotGames/artifact-cookbook.git' with branch: '0.10.0' does not satisfy the version constraint (= 0.9.8)
|
|
246
246
|
"""
|
|
247
|
-
And the CLI should exit with the status code for error "
|
|
247
|
+
And the CLI should exit with the status code for error "CookbookValidationFailure"
|
|
248
248
|
|
|
249
249
|
Scenario: when a git location source is defined and a cookbook of the same name is already cached in the cookbook store
|
|
250
250
|
Given I write to "Berksfile" with:
|
|
@@ -276,17 +276,17 @@ Feature: install cookbooks from a Berksfile
|
|
|
276
276
|
Scenario: with a cookbook definition containing a chef_api source location
|
|
277
277
|
Given I write to "Berksfile" with:
|
|
278
278
|
"""
|
|
279
|
-
cookbook "
|
|
279
|
+
cookbook "cuke-test", "= 1.0.0", chef_api: :config
|
|
280
280
|
"""
|
|
281
281
|
And the Chef server has cookbooks:
|
|
282
|
-
|
|
|
282
|
+
| cuke-test | 1.0.0 |
|
|
283
283
|
When I successfully run `berks install`
|
|
284
284
|
Then the output should contain:
|
|
285
285
|
"""
|
|
286
|
-
Installing
|
|
286
|
+
Installing cuke-test (1.0.0) from chef_api:
|
|
287
287
|
"""
|
|
288
288
|
And the cookbook store should have the cookbooks:
|
|
289
|
-
|
|
|
289
|
+
| cuke-test | 1.0.0 |
|
|
290
290
|
And the exit status should be 0
|
|
291
291
|
|
|
292
292
|
Scenario: with a chef_api source location specifying :config when a Berkshelf config is not found at the given path
|
|
@@ -302,42 +302,6 @@ Feature: install cookbooks from a Berksfile
|
|
|
302
302
|
"""
|
|
303
303
|
And the CLI should exit with the status code for error "BerksConfigNotFound"
|
|
304
304
|
|
|
305
|
-
Scenario: with a chef_api source location specifying a Chef API URL but missing a node_name option
|
|
306
|
-
Given I write to "Berksfile" with:
|
|
307
|
-
"""
|
|
308
|
-
cookbook "artifact", chef_api: "https://api.opscode.com/organizations/vialstudios", client_key: "/Users/reset/.chef/knife.rb"
|
|
309
|
-
"""
|
|
310
|
-
When I run `berks install`
|
|
311
|
-
Then the output should contain:
|
|
312
|
-
"""
|
|
313
|
-
Source 'artifact' is a 'chef_api' location with a URL for it's value but is missing options: 'node_name'.
|
|
314
|
-
"""
|
|
315
|
-
And the CLI should exit with the status code for error "InvalidChefAPILocation"
|
|
316
|
-
|
|
317
|
-
Scenario: with a chef_api source location specifying a Chef API URL but missing a client_key option
|
|
318
|
-
Given I write to "Berksfile" with:
|
|
319
|
-
"""
|
|
320
|
-
cookbook "artifact", chef_api: "https://api.opscode.com/organizations/vialstudios", node_name: "reset"
|
|
321
|
-
"""
|
|
322
|
-
When I run `berks install`
|
|
323
|
-
Then the output should contain:
|
|
324
|
-
"""
|
|
325
|
-
Source 'artifact' is a 'chef_api' location with a URL for it's value but is missing options: 'client_key'.
|
|
326
|
-
"""
|
|
327
|
-
And the CLI should exit with the status code for error "InvalidChefAPILocation"
|
|
328
|
-
|
|
329
|
-
Scenario: with a chef_api source location specifying a Chef API URL but missing a client_key option
|
|
330
|
-
Given I write to "Berksfile" with:
|
|
331
|
-
"""
|
|
332
|
-
cookbook "artifact", chef_api: "https://api.opscode.com/organizations/vialstudios"
|
|
333
|
-
"""
|
|
334
|
-
When I run `berks install`
|
|
335
|
-
Then the output should contain:
|
|
336
|
-
"""
|
|
337
|
-
Source 'artifact' is a 'chef_api' location with a URL for it's value but is missing options: 'node_name', 'client_key'.
|
|
338
|
-
"""
|
|
339
|
-
And the CLI should exit with the status code for error "InvalidChefAPILocation"
|
|
340
|
-
|
|
341
305
|
Scenario: with a git error during download
|
|
342
306
|
Given I write to "Berksfile" with:
|
|
343
307
|
"""
|
|
@@ -348,7 +312,7 @@ Feature: install cookbooks from a Berksfile
|
|
|
348
312
|
Then the output should contain:
|
|
349
313
|
"""
|
|
350
314
|
Installing ohai (1.1.4) from site: 'http://cookbooks.opscode.com/api/v1/cookbooks'
|
|
351
|
-
Failed to download doesntexist from git: 'git://github.com/asdjhfkljashflkjashfakljsf'
|
|
315
|
+
Failed to download 'doesntexist' from git: 'git://github.com/asdjhfkljashflkjashfakljsf'
|
|
352
316
|
An error occured during Git execution:
|
|
353
317
|
"""
|
|
354
318
|
And the CLI should exit with the status code for error "GitError"
|