berkshelf 2.0.0.beta → 2.0.0
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/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
@@ -0,0 +1,155 @@
|
|
1
|
+
module Berkshelf
|
2
|
+
module Mixin
|
3
|
+
module Config
|
4
|
+
def self.included(base)
|
5
|
+
base.send(:extend, ClassMethods)
|
6
|
+
end
|
7
|
+
|
8
|
+
module ClassMethods
|
9
|
+
# Load a Chef configuration from the given path.
|
10
|
+
#
|
11
|
+
# @raise [Berkshelf::ConfigNotFound]
|
12
|
+
# if the specified path does not exist on the system
|
13
|
+
def from_file(filepath)
|
14
|
+
self.new(filepath)
|
15
|
+
rescue Errno::ENOENT => e
|
16
|
+
raise Berkshelf::ConfigNotFound.new(self.class.name, filepath)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Load the contents of the most probable Chef config. See {location}
|
20
|
+
# for more information on how this logic is decided.
|
21
|
+
def load
|
22
|
+
self.new(location)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Class method for defining a default option.
|
26
|
+
#
|
27
|
+
# @param [#to_sym] option
|
28
|
+
# the symbol to store as the key
|
29
|
+
# @param [Object] value
|
30
|
+
# the return value
|
31
|
+
def default_option(option, value)
|
32
|
+
default_options[option.to_sym] = value
|
33
|
+
end
|
34
|
+
|
35
|
+
# A list of all the default options set by this class.
|
36
|
+
#
|
37
|
+
# @return [Hash]
|
38
|
+
def default_options
|
39
|
+
@default_options ||= {}
|
40
|
+
end
|
41
|
+
|
42
|
+
# The default location of the configuration file.
|
43
|
+
#
|
44
|
+
# @param [#to_s] path
|
45
|
+
# the path to the default location of the configuration file
|
46
|
+
def default_location(path)
|
47
|
+
@default_location = File.expand_path(path)
|
48
|
+
end
|
49
|
+
|
50
|
+
# @return [String, nil]
|
51
|
+
attr_reader :default_location
|
52
|
+
|
53
|
+
# Converts a path to a path usable for your current platform
|
54
|
+
#
|
55
|
+
# @param [String] path
|
56
|
+
#
|
57
|
+
# @return [String]
|
58
|
+
def platform_specific_path(path)
|
59
|
+
if RUBY_PLATFORM =~ /mswin|mingw|windows/
|
60
|
+
system_drive = ENV['SYSTEMDRIVE'] ? ENV['SYSTEMDRIVE'] : ""
|
61
|
+
path = win_slashify File.join(system_drive, path.split('/')[2..-1])
|
62
|
+
end
|
63
|
+
|
64
|
+
path
|
65
|
+
end
|
66
|
+
|
67
|
+
private
|
68
|
+
# @abstract
|
69
|
+
# include and override {location} in your class to define the
|
70
|
+
# default location logic
|
71
|
+
def location
|
72
|
+
default_location || raise(AbstractFunction, "You must implement #{self.class}#location to define default location logic!")
|
73
|
+
end
|
74
|
+
|
75
|
+
# Convert a unixy filepath to a windowsy filepath. Swaps forward slashes for
|
76
|
+
# double backslashes
|
77
|
+
#
|
78
|
+
# @param [String] path
|
79
|
+
# filepath to convert
|
80
|
+
#
|
81
|
+
# @return [String]
|
82
|
+
# converted filepath
|
83
|
+
def win_slashify(path)
|
84
|
+
path.gsub(File::SEPARATOR, (File::ALT_SEPARATOR || '\\'))
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# The path to the file.
|
89
|
+
#
|
90
|
+
# @return [String, nil]
|
91
|
+
attr_reader :path
|
92
|
+
|
93
|
+
# Create a new configuration file from the given path.
|
94
|
+
#
|
95
|
+
# @param [#to_s, nil] filepath
|
96
|
+
# the filepath to read
|
97
|
+
def initialize(filepath = nil)
|
98
|
+
@path = filepath ? File.expand_path(filepath.to_s) : nil
|
99
|
+
load
|
100
|
+
end
|
101
|
+
|
102
|
+
# Read and evaluate the contents of the filepath, if one was given at the
|
103
|
+
# start.
|
104
|
+
#
|
105
|
+
# @return [Berkshelf::Mixin::Config]
|
106
|
+
def load
|
107
|
+
configuration # Need to call this to make sure it's populated
|
108
|
+
self.instance_eval(IO.read(path), path, 1) if path && File.exists?(path)
|
109
|
+
self
|
110
|
+
end
|
111
|
+
|
112
|
+
# Force a reload the contents of this file from disk.
|
113
|
+
#
|
114
|
+
# @return [Berkshelf::Mixin::Config]
|
115
|
+
def reload!
|
116
|
+
@configuration = nil
|
117
|
+
load
|
118
|
+
self
|
119
|
+
end
|
120
|
+
|
121
|
+
# Return the configuration value for the given key.
|
122
|
+
#
|
123
|
+
# @param [#to_sym] key
|
124
|
+
# they key to find a configuration value for
|
125
|
+
def [](key)
|
126
|
+
configuration[key.to_sym]
|
127
|
+
end
|
128
|
+
|
129
|
+
def method_missing(m, *args, &block)
|
130
|
+
if args.length > 0
|
131
|
+
configuration[m.to_sym] = (args.length == 1) ? args[0] : args
|
132
|
+
else
|
133
|
+
configuration[m.to_sym]
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
# Save the contents of the file to the originally-supplied path.
|
138
|
+
def save
|
139
|
+
File.open(path, 'w+') { |f| f.write(to_rb + "\n") }
|
140
|
+
end
|
141
|
+
|
142
|
+
# Convert the file back to Ruby.
|
143
|
+
#
|
144
|
+
# @return [String]
|
145
|
+
def to_rb
|
146
|
+
configuration.map { |k,v| "#{k}(#{v.inspect})" }.join("\n")
|
147
|
+
end
|
148
|
+
|
149
|
+
private
|
150
|
+
def configuration
|
151
|
+
@configuration ||= self.class.default_options.dup
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'hashie'
|
2
|
+
|
3
|
+
module Berkshelf
|
4
|
+
module Mixin
|
5
|
+
module Shellout
|
6
|
+
# Perform a cross-platform shell command, returning the process result.
|
7
|
+
# This uses Process.spawn under the hood for Ruby 1.9, so see
|
8
|
+
# {Process.spawn} for more information.
|
9
|
+
#
|
10
|
+
# On JRuby, a system command is used and $stdout and $stderr are captured.
|
11
|
+
#
|
12
|
+
# @param [String] command
|
13
|
+
# @param [Hash] options
|
14
|
+
# a list of options to send to {Process.spawn}
|
15
|
+
# @return [Hashie::Mash]
|
16
|
+
# information about the command including:
|
17
|
+
# - stderr
|
18
|
+
# - stdout
|
19
|
+
# - exitstatus
|
20
|
+
# - pid
|
21
|
+
# - success?
|
22
|
+
# - failure?
|
23
|
+
def shellout(command)
|
24
|
+
if defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java' # jruby
|
25
|
+
out, err, e = capture do
|
26
|
+
system(command)
|
27
|
+
end
|
28
|
+
else
|
29
|
+
begin
|
30
|
+
out_file, err_file = Tempfile.new('berkshelf.stdout'), Tempfile.new('berkshelf.stderr')
|
31
|
+
pid = Process.spawn({}, command, out: out_file.to_i, err: err_file.to_i)
|
32
|
+
Process.waitpid(pid)
|
33
|
+
|
34
|
+
out, err = File.read(out_file), File.read(err_file)
|
35
|
+
e = $?
|
36
|
+
rescue Errno::ENOENT
|
37
|
+
out, err = "", "command not found: #{command}"
|
38
|
+
e = $?
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
Hashie::Mash.new({
|
43
|
+
stdout: out.strip,
|
44
|
+
stderr: err.strip,
|
45
|
+
exitstatus: e.exitstatus,
|
46
|
+
pid: e.pid,
|
47
|
+
success?: e.success?,
|
48
|
+
failure?: !e.success?
|
49
|
+
})
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
# Execute the given block, capturing $stdout, $stderr, and the returned process.
|
54
|
+
#
|
55
|
+
# @return [Array<StringIO, StringIO, Process>]
|
56
|
+
# a tuple of $stdout, $stderr, and the Process
|
57
|
+
def capture(&block)
|
58
|
+
out, err = StringIO.new, StringIO.new
|
59
|
+
$stdout, $stderr = out, err
|
60
|
+
|
61
|
+
yield
|
62
|
+
|
63
|
+
out.rewind
|
64
|
+
err.rewind
|
65
|
+
return out.read, err.read, $?
|
66
|
+
ensure
|
67
|
+
$stdout, $stderr = STDOUT, STDERR
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
data/lib/berkshelf/resolver.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
module Berkshelf
|
2
|
-
# @author Jamie Winsor <reset@riotgames.com>
|
3
2
|
class Resolver
|
3
|
+
require_relative 'cookbook_source'
|
4
|
+
require_relative 'locations/git_location'
|
5
|
+
require_relative 'locations/path_location'
|
6
|
+
|
4
7
|
extend Forwardable
|
5
8
|
|
6
9
|
# @return [Berkshelf::Berksfile]
|
@@ -132,7 +135,7 @@ module Berkshelf
|
|
132
135
|
# @return [Boolean]
|
133
136
|
def install_source(source)
|
134
137
|
cached_cookbook, location = downloader.download(source)
|
135
|
-
Berkshelf.formatter.install
|
138
|
+
Berkshelf.formatter.install(source.name, cached_cookbook.version, location)
|
136
139
|
end
|
137
140
|
|
138
141
|
# Use the given source to create a constraint solution if the source has been downloaded or can
|
@@ -164,8 +167,8 @@ module Berkshelf
|
|
164
167
|
get_source(source).cached_cookbook = cached
|
165
168
|
end
|
166
169
|
|
167
|
-
path = source.location.is_a?(PathLocation) ?
|
168
|
-
Berkshelf.formatter.use
|
170
|
+
path = source.location.is_a?(PathLocation) ? source.location.to_s : nil
|
171
|
+
Berkshelf.formatter.use(cached.cookbook_name, cached.version, path)
|
169
172
|
|
170
173
|
true
|
171
174
|
end
|
data/lib/berkshelf/test.rb
CHANGED
@@ -3,8 +3,6 @@ module Berkshelf
|
|
3
3
|
# stubs across a run (See RiotGames/berkshelf#208). As a work-around, we pass
|
4
4
|
# "special" mocks and stubs into the TEST environment variable. This class
|
5
5
|
# parses and then requires the appropriate mocks during the run.
|
6
|
-
#
|
7
|
-
# @author Seth Vargo <sethvargo@gmail.com>
|
8
6
|
class Mocks
|
9
7
|
require 'rspec/mocks/standalone'
|
10
8
|
|
@@ -34,4 +32,4 @@ end
|
|
34
32
|
|
35
33
|
unless (keys = Berkshelf::Mocks.env_keys & ENV.keys).empty?
|
36
34
|
Berkshelf::Mocks.new(keys)
|
37
|
-
end
|
35
|
+
end
|
data/lib/berkshelf/ui.rb
CHANGED
@@ -10,12 +10,16 @@ module Berkshelf
|
|
10
10
|
@mute = false
|
11
11
|
end
|
12
12
|
|
13
|
-
def say(message =
|
13
|
+
def say(message = '', color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/))
|
14
14
|
return if quiet?
|
15
15
|
|
16
|
-
super(message, color)
|
16
|
+
super(message, color, force_new_line)
|
17
|
+
end
|
18
|
+
|
19
|
+
# @see {say}
|
20
|
+
def info(message = '', color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/))
|
21
|
+
say(message, color, force_new_line)
|
17
22
|
end
|
18
|
-
alias_method :info, :say
|
19
23
|
|
20
24
|
def say_status(status, message, log_status = true)
|
21
25
|
return if quiet?
|
@@ -25,7 +29,7 @@ module Berkshelf
|
|
25
29
|
|
26
30
|
def warn(message, color = :yellow)
|
27
31
|
return if quiet?
|
28
|
-
|
32
|
+
|
29
33
|
say(message, color)
|
30
34
|
end
|
31
35
|
|
data/lib/berkshelf/version.rb
CHANGED
data/lib/thor/monkies/shell.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
-----BEGIN RSA PRIVATE KEY-----
|
2
|
+
MIIEpQIBAAKCAQEAs3u5qfmdEWtzYHvXpbQRyefhUjeTG7nwhn/LaYY6ou19xxW0
|
3
|
+
I5MKSBqCxUCHqODRc7ox8zSF37x3jMBHbSczOcfbWsSe/qGnmvZZQhHmXCje2zkW
|
4
|
+
ByaRHmmatzkz1aAqAmZm/wdSuVLXytsbrPXuaj/MiHa6QH3e/ZFaYME7rMkouqfC
|
5
|
+
pUlSa2tZ9Ko1ZCCwjkiifuP4yQFsS6/G6b8c7F8wdq4byfJ9o6FN34lJHrzfG0ZV
|
6
|
+
hwS47Bdn6FDBQ6PVxrBsvQNE2n7QlNLfXWi4Tb8OpmQif01FjxleAr5kamx3GD+s
|
7
|
+
jC7fKHE9bZ0apZ1MVmkz9PhFmOigV5jl9Att+QIDAQABAoIBAQCCG6qXgQ9PVWkq
|
8
|
+
BBxrToGmr6UzCH5nlv65QWKfeGKBQU/wRdd0Al9trWomu4Sb831iOxOCjgyOB/1R
|
9
|
+
1wDwK36C4FIvFmF7jIwHVZWWw4sOO8JxgIxrWpXQShW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vjAoGAWorll+fomfie6t5XbkpwMo8rn60yFUiRE7HWxA2qDj3IpoE6SfNE
|
25
|
+
eOpsf1Zzx30r8answ9lPnd753ACdgNzE66ScWD+cQeB6OlMZMaW5tVSjddZ7854L
|
26
|
+
00znt8b1OLkVY33xfsa89wKH343304BhVHABPMxm5Leua/H21/BqSK0=
|
27
|
+
-----END RSA PRIVATE KEY-----
|
@@ -0,0 +1,12 @@
|
|
1
|
+
current_dir = File.expand_path(File.dirname(__FILE__))
|
2
|
+
|
3
|
+
log_level :info
|
4
|
+
log_location STDOUT
|
5
|
+
node_name "berkshelf"
|
6
|
+
client_key "#{current_dir}/berkshelf.pem"
|
7
|
+
validation_client_name "validator"
|
8
|
+
validation_key "#{current_dir}/validator.pem"
|
9
|
+
chef_server_url "http://localhost:4000"
|
10
|
+
cache_type 'BasicFile'
|
11
|
+
cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
|
12
|
+
cookbook_path []
|
@@ -0,0 +1,27 @@
|
|
1
|
+
-----BEGIN RSA PRIVATE KEY-----
|
2
|
+
MIIEowIBAAKCAQEAxvMbzsVt0PJ0ozcpQZC+zpaWYAZe/nHnSFeTkm9BAtQUA8vp
|
3
|
+
cKMJTXNw4Lm3jcotrPATMgGgwVG7ram689JcQSnwSgIFinr5ZLRB22qyGdqHHmAf
|
4
|
+
w4RVde6dJON2IqI51JzQ5Pfs+M1SYcKiCzcBHvFddug5VcMjipFLv7QPKDmal8Ep
|
5
|
+
tOtRhb8Ad2DBXV7gX3e8ZaKfQgA0uc07g1KmcjR7vOG25nxY6NRxTwWn5+uMVgCp
|
6
|
+
1xjbBeq7XF2gJPYVNsNRu8C3/rMX7D3NuKpJGj3CsKOtECREsq+7lk7A7OPzrP0g
|
7
|
+
Um/dUSeV99FLavrJNZ8TRc+BLZD/RiE1x0wG9wIDAQABAoIBAAbRchSGA5tzk7e8
|
8
|
+
Pje3BDMESicEUOEbejeqeK4+DdZQ+lae+GMZ00nKOQYal0XOtf4FREMkdy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F2iulM7JxSqFnSOHz6aoHkKZItvpj2FHpPTZCCN
|
24
|
+
sXgxKQKBgDyBsl4/LCG+eQrxaL6Y7DHP9oNTw5hRbQWlZlXfygyUbKCqj1OfOrVu
|
25
|
+
hDAn/ElMLgSgRbI8nXq68cu6UE4wO4Di6fQyCb2pP7tgS+0swbq85YoMbHh/z+yN
|
26
|
+
WUvLQHfN4RHJStY3JX/cBcSoIiArNbuFcPThM02YBDhbiW+NQhZV
|
27
|
+
-----END RSA PRIVATE KEY-----
|
data/spec/spec_helper.rb
CHANGED
@@ -7,7 +7,6 @@ require 'bundler'
|
|
7
7
|
require 'spork'
|
8
8
|
|
9
9
|
Spork.prefork do
|
10
|
-
require 'json_spec'
|
11
10
|
require 'pp'
|
12
11
|
require 'rspec'
|
13
12
|
require 'webmock/rspec'
|
@@ -15,7 +14,7 @@ Spork.prefork do
|
|
15
14
|
|
16
15
|
APP_ROOT = File.expand_path('../../', __FILE__)
|
17
16
|
ENV["BERKSHELF_PATH"] = File.join(APP_ROOT, "spec", "tmp", "berkshelf")
|
18
|
-
ENV["BERKSHELF_CHEF_CONFIG"] = File.join(APP_ROOT, "spec", "knife.rb")
|
17
|
+
ENV["BERKSHELF_CHEF_CONFIG"] = File.join(APP_ROOT, "spec", "config", "knife.rb")
|
19
18
|
|
20
19
|
Dir[File.join(APP_ROOT, "spec/support/**/*.rb")].each {|f| require f}
|
21
20
|
|
@@ -29,7 +28,6 @@ Spork.prefork do
|
|
29
28
|
|
30
29
|
RSpec.configure do |config|
|
31
30
|
config.include Berkshelf::RSpec::FileSystemMatchers
|
32
|
-
config.include JsonSpec::Helpers
|
33
31
|
config.include Berkshelf::RSpec::ChefAPI
|
34
32
|
config.include Berkshelf::RSpec::ChefServer
|
35
33
|
|
@@ -43,12 +41,12 @@ Spork.prefork do
|
|
43
41
|
config.filter_run focus: true
|
44
42
|
config.run_all_when_everything_filtered = true
|
45
43
|
|
46
|
-
config.before(:
|
44
|
+
config.before(:suite) do
|
47
45
|
Berkshelf::RSpec::ChefServer.start
|
48
46
|
WebMock.disable_net_connect!(allow_localhost: true, net_http_connect_on_start: true)
|
49
47
|
end
|
50
48
|
|
51
|
-
config.after(:
|
49
|
+
config.after(:suite) do
|
52
50
|
Berkshelf::RSpec::ChefServer.stop
|
53
51
|
end
|
54
52
|
|
@@ -119,7 +117,7 @@ Spork.prefork do
|
|
119
117
|
path = ''
|
120
118
|
capture(:stdout) do
|
121
119
|
Dir.chdir(remote_bucket) do
|
122
|
-
Berkshelf::Cli.new.invoke(:cookbook, [name], skip_vagrant: true, force: true)
|
120
|
+
Berkshelf::Cli.new.invoke(:cookbook, [name], skip_vagrant: true, skip_test_kitchen: true, force: true)
|
123
121
|
end
|
124
122
|
|
125
123
|
Dir.chdir(path = remote_bucket.join(name)) do
|
@@ -174,8 +172,6 @@ Spork.prefork do
|
|
174
172
|
def run(cmd)
|
175
173
|
`#{cmd}`
|
176
174
|
end
|
177
|
-
|
178
|
-
Berkshelf::RSpec::Knife.load_knife_config(File.join(APP_ROOT, 'spec/knife.rb'))
|
179
175
|
end
|
180
176
|
|
181
177
|
Spork.each_run do
|