berkshelf 7.0.7 → 7.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -3
- data/Rakefile +4 -4
- data/berkshelf.gemspec +10 -12
- data/bin/berks +5 -0
- data/lib/berkshelf.rb +8 -9
- data/lib/berkshelf/api_client/chef_server_connection.rb +3 -2
- data/lib/berkshelf/api_client/connection.rb +1 -1
- data/lib/berkshelf/api_client/remote_cookbook.rb +1 -1
- data/lib/berkshelf/berksfile.rb +41 -39
- data/lib/berkshelf/cached_cookbook.rb +6 -4
- data/lib/berkshelf/chef_config_compat.rb +2 -1
- data/lib/berkshelf/chef_repo_universe.rb +6 -4
- data/lib/berkshelf/cli.rb +6 -6
- data/lib/berkshelf/commands/shelf.rb +1 -1
- data/lib/berkshelf/community_rest.rb +6 -6
- data/lib/berkshelf/config.rb +3 -3
- data/lib/berkshelf/cookbook_store.rb +2 -4
- data/lib/berkshelf/core_ext.rb +1 -1
- data/lib/berkshelf/core_ext/file_utils.rb +3 -3
- data/lib/berkshelf/dependency.rb +1 -1
- data/lib/berkshelf/downloader.rb +9 -6
- data/lib/berkshelf/errors.rb +5 -2
- data/lib/berkshelf/file_syncer.rb +7 -12
- data/lib/berkshelf/formatters/human.rb +1 -1
- data/lib/berkshelf/formatters/json.rb +4 -4
- data/lib/berkshelf/installer.rb +1 -1
- data/lib/berkshelf/location.rb +3 -3
- data/lib/berkshelf/locations/git.rb +6 -12
- data/lib/berkshelf/lockfile.rb +14 -14
- data/lib/berkshelf/logger.rb +4 -2
- data/lib/berkshelf/mixin/git.rb +3 -3
- data/lib/berkshelf/packager.rb +5 -7
- data/lib/berkshelf/resolver.rb +1 -1
- data/lib/berkshelf/ridley_compat.rb +1 -1
- data/lib/berkshelf/shell.rb +2 -1
- data/lib/berkshelf/shell_out.rb +4 -3
- data/lib/berkshelf/source.rb +8 -7
- data/lib/berkshelf/source_uri.rb +1 -1
- data/lib/berkshelf/ssl_policies.rb +5 -9
- data/lib/berkshelf/thor.rb +1 -1
- data/lib/berkshelf/thor_ext.rb +1 -1
- data/lib/berkshelf/uploader.rb +11 -9
- data/lib/berkshelf/validator.rb +2 -8
- data/lib/berkshelf/version.rb +1 -1
- data/lib/berkshelf/visualizer.rb +3 -3
- data/spec/config/knife.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/support/chef_server.rb +2 -2
- data/spec/support/git.rb +18 -18
- data/spec/support/path_helpers.rb +4 -4
- data/spec/unit/berkshelf/berksfile_spec.rb +7 -7
- data/spec/unit/berkshelf/cli_spec.rb +1 -2
- data/spec/unit/berkshelf/community_rest_spec.rb +1 -1
- data/spec/unit/berkshelf/core_ext/file_utils_spec.rb +2 -2
- data/spec/unit/berkshelf/dependency_spec.rb +5 -5
- data/spec/unit/berkshelf/downloader_spec.rb +4 -8
- data/spec/unit/berkshelf/locations/base_spec.rb +1 -2
- data/spec/unit/berkshelf/locations/git_spec.rb +2 -5
- data/spec/unit/berkshelf/locations/path_spec.rb +1 -2
- data/spec/unit/berkshelf/lockfile_spec.rb +9 -18
- data/spec/unit/berkshelf/ridley_compat_spec.rb +2 -2
- data/spec/unit/berkshelf/source_spec.rb +30 -19
- data/spec/unit/berkshelf/ssl_policies_spec.rb +3 -6
- data/spec/unit/berkshelf/uploader_spec.rb +6 -10
- data/spec/unit/berkshelf/validator_spec.rb +0 -13
- metadata +39 -193
- data/.github/lock.yml +0 -1
- data/.gitignore +0 -30
- data/.rubocop.yml +0 -12
- data/.travis.yml +0 -73
- data/CHANGELOG.legacy.md +0 -307
- data/CHANGELOG.md +0 -1589
- data/CONTRIBUTING.md +0 -68
- data/Gemfile.lock +0 -292
- data/PLUGINS.md +0 -25
- data/README.md +0 -72
- data/Thorfile +0 -61
- data/appveyor.yml +0 -31
- data/docs/berkshelf_for_newcomers.md +0 -64
- data/features/artifactory.feature +0 -70
- data/features/berksfile.feature +0 -46
- data/features/commands/apply.feature +0 -41
- data/features/commands/contingent.feature +0 -47
- data/features/commands/info.feature +0 -141
- data/features/commands/install.feature +0 -646
- data/features/commands/list.feature +0 -78
- data/features/commands/outdated.feature +0 -176
- data/features/commands/package.feature +0 -17
- data/features/commands/search.feature +0 -17
- data/features/commands/shelf/list.feature +0 -32
- data/features/commands/shelf/show.feature +0 -113
- data/features/commands/shelf/uninstall.feature +0 -96
- data/features/commands/show.feature +0 -83
- data/features/commands/update.feature +0 -142
- data/features/commands/upload.feature +0 -499
- data/features/commands/vendor.feature +0 -154
- data/features/commands/verify.feature +0 -29
- data/features/commands/viz.feature +0 -66
- data/features/community_site.feature +0 -37
- data/features/help.feature +0 -11
- data/features/json_formatter.feature +0 -158
- data/features/lifecycle.feature +0 -378
- data/features/lockfile.feature +0 -378
- data/features/step_definitions/berksfile_steps.rb +0 -54
- data/features/step_definitions/chef/config_steps.rb +0 -12
- data/features/step_definitions/chef_server_steps.rb +0 -60
- data/features/step_definitions/cli_steps.rb +0 -18
- data/features/step_definitions/config_steps.rb +0 -46
- data/features/step_definitions/environment_steps.rb +0 -11
- data/features/step_definitions/filesystem_steps.rb +0 -286
- data/features/step_definitions/gem_steps.rb +0 -13
- data/features/step_definitions/json_steps.rb +0 -29
- data/features/step_definitions/utility_steps.rb +0 -11
- data/features/support/aruba.rb +0 -12
- data/features/support/env.rb +0 -77
- data/spec/fixtures/cookbooks/example_cookbook/.gitignore +0 -2
- data/spec/fixtures/cookbooks/example_cookbook/.kitchen.yml +0 -26
@@ -5,14 +5,12 @@ module Berkshelf
|
|
5
5
|
let(:berksfile) do
|
6
6
|
double(Berksfile,
|
7
7
|
lockfile: lockfile,
|
8
|
-
dependencies: []
|
9
|
-
)
|
8
|
+
dependencies: [])
|
10
9
|
end
|
11
10
|
|
12
11
|
let(:lockfile) do
|
13
12
|
double(Lockfile,
|
14
|
-
graph: graph
|
15
|
-
)
|
13
|
+
graph: graph)
|
16
14
|
end
|
17
15
|
|
18
16
|
let(:graph) { double(Lockfile::Graph, locks: {}) }
|
@@ -124,15 +122,13 @@ module Berkshelf
|
|
124
122
|
cookbook_copyright: "user",
|
125
123
|
cookbook_email: "user@example.com",
|
126
124
|
cookbook_license: "apachev2",
|
127
|
-
trusted_certs_dir: self_signed_crt_path
|
128
|
-
)
|
125
|
+
trusted_certs_dir: self_signed_crt_path)
|
129
126
|
end
|
130
127
|
|
131
128
|
let(:berkshelf_config) do
|
132
129
|
double(Config,
|
133
130
|
ssl: double(verify: true),
|
134
|
-
chef: chef_config
|
135
|
-
)
|
131
|
+
chef: chef_config)
|
136
132
|
end
|
137
133
|
|
138
134
|
before do
|
@@ -104,11 +104,10 @@ module Berkshelf
|
|
104
104
|
|
105
105
|
context "when the repository is cached" do
|
106
106
|
it "pulls a new version" do
|
107
|
-
|
108
|
-
|
107
|
+
cache_path = subject.send(:cache_path)
|
109
108
|
allow(subject).to receive(:cached?).and_return(true)
|
110
109
|
expect(subject).to receive(:git).with(
|
111
|
-
'fetch --force --tags https://repo.com "refs/heads/*:refs/heads/*"'
|
110
|
+
'fetch --force --tags https://repo.com "refs/heads/*:refs/heads/*"', cwd: cache_path.to_s
|
112
111
|
)
|
113
112
|
subject.install
|
114
113
|
end
|
@@ -116,8 +115,6 @@ module Berkshelf
|
|
116
115
|
|
117
116
|
context "when the revision is not cached" do
|
118
117
|
it "clones the repository" do
|
119
|
-
allow(Dir).to receive(:chdir) { |args, &b| b.call } # Force eval the chdir block
|
120
|
-
|
121
118
|
cache_path = subject.send(:cache_path)
|
122
119
|
allow(subject).to receive(:cached?).and_return(false)
|
123
120
|
expect(subject).to receive(:git).with(
|
@@ -8,8 +8,7 @@ module Berkshelf
|
|
8
8
|
double("dependency",
|
9
9
|
name: "nginx",
|
10
10
|
version_constraint: constraint,
|
11
|
-
berksfile: berksfile
|
12
|
-
)
|
11
|
+
berksfile: berksfile)
|
13
12
|
end
|
14
13
|
let(:path) { fixtures_path.join("cookbooks", "example_cookbook") }
|
15
14
|
let(:relative_path) { Pathname.new("../../../fixtures/cookbooks/example_cookbook") }
|
@@ -8,8 +8,7 @@ describe Berkshelf::Lockfile do
|
|
8
8
|
let(:lock_path) { File.absolute_path("/path/to/Bacon") }
|
9
9
|
let(:berksfile) do
|
10
10
|
double("Berksfile",
|
11
|
-
filepath: lock_path
|
12
|
-
)
|
11
|
+
filepath: lock_path)
|
13
12
|
end
|
14
13
|
|
15
14
|
subject { described_class.from_berksfile(berksfile) }
|
@@ -77,8 +76,7 @@ describe Berkshelf::Lockfile do
|
|
77
76
|
version: "1.0.0",
|
78
77
|
location: "api",
|
79
78
|
dependencies: {},
|
80
|
-
cached_cookbook: cookbook
|
81
|
-
)
|
79
|
+
cached_cookbook: cookbook)
|
82
80
|
berksfile = double("berksfile", dependencies: [apt])
|
83
81
|
subject.instance_variable_set(:@berksfile, berksfile)
|
84
82
|
allow(subject).to receive(:find).with(apt).and_return(apt)
|
@@ -95,8 +93,7 @@ describe Berkshelf::Lockfile do
|
|
95
93
|
version: "1.0.0",
|
96
94
|
location: "api",
|
97
95
|
dependencies: { "bacon" => "1.0.0" },
|
98
|
-
cached_cookbook: cookbook
|
99
|
-
)
|
96
|
+
cached_cookbook: cookbook)
|
100
97
|
bacon = double(name: "bacon", version: "1.0.0", dependencies: {})
|
101
98
|
berksfile = double("berksfile", dependencies: [apt])
|
102
99
|
subject.instance_variable_set(:@berksfile, berksfile)
|
@@ -115,15 +112,13 @@ describe Berkshelf::Lockfile do
|
|
115
112
|
version: "1.0.0",
|
116
113
|
location: "api",
|
117
114
|
dependencies: { "bacon" => "1.0.0" },
|
118
|
-
cached_cookbook: cookbook
|
119
|
-
)
|
115
|
+
cached_cookbook: cookbook)
|
120
116
|
bacon = double("bacon",
|
121
117
|
name: "bacon",
|
122
118
|
version_constraint: Semverse::Constraint.new(">= 0.0.0"),
|
123
119
|
version: "1.0.0",
|
124
120
|
location: "api",
|
125
|
-
dependencies: { "apt" => "1.0.0" }
|
126
|
-
)
|
121
|
+
dependencies: { "apt" => "1.0.0" })
|
127
122
|
berksfile = double("berksfile", dependencies: [apt])
|
128
123
|
subject.instance_variable_set(:@berksfile, berksfile)
|
129
124
|
allow(subject).to receive(:find).with(apt).and_return(apt)
|
@@ -141,8 +136,7 @@ describe Berkshelf::Lockfile do
|
|
141
136
|
version: "1.0.0",
|
142
137
|
location: "api",
|
143
138
|
dependencies: { "bacon" => "1.0.0" },
|
144
|
-
cached_cookbook: cookbook
|
145
|
-
)
|
139
|
+
cached_cookbook: cookbook)
|
146
140
|
berksfile = double("berksfile", dependencies: [apt])
|
147
141
|
subject.instance_variable_set(:@berksfile, berksfile)
|
148
142
|
allow(subject).to receive(:find).with(apt).and_return(apt)
|
@@ -177,8 +171,7 @@ describe Berkshelf::Lockfile do
|
|
177
171
|
version: "1.0.0",
|
178
172
|
location: "api",
|
179
173
|
dependencies: {},
|
180
|
-
cached_cookbook: cookbook
|
181
|
-
)
|
174
|
+
cached_cookbook: cookbook)
|
182
175
|
berksfile = double("berksfile", dependencies: [apt])
|
183
176
|
subject.instance_variable_set(:@berksfile, berksfile)
|
184
177
|
allow(subject).to receive(:find).with(apt).and_return(apt)
|
@@ -195,8 +188,7 @@ describe Berkshelf::Lockfile do
|
|
195
188
|
version: "1.0.0",
|
196
189
|
location: "api",
|
197
190
|
dependencies: {},
|
198
|
-
cached_cookbook: cookbook
|
199
|
-
)
|
191
|
+
cached_cookbook: cookbook)
|
200
192
|
apt_master = apt.dup
|
201
193
|
allow(apt_master).to receive_messages(location: "github")
|
202
194
|
allow(apt_master).to receive_messages(cached_cookbook: cookbook)
|
@@ -393,8 +385,7 @@ describe Berkshelf::Lockfile::Graph do
|
|
393
385
|
name: "test-0.0.1",
|
394
386
|
version: "0.0.1",
|
395
387
|
cookbook_name: "test",
|
396
|
-
dependencies: {}
|
397
|
-
)
|
388
|
+
dependencies: {})
|
398
389
|
subject.update([cookbook])
|
399
390
|
|
400
391
|
expect(subject.locks.keys).to include(cookbook.cookbook_name)
|
@@ -2,9 +2,9 @@ require "spec_helper"
|
|
2
2
|
require "chef/cookbook_manifest"
|
3
3
|
|
4
4
|
describe Berkshelf::RidleyCompat do
|
5
|
-
let(:opts) {
|
5
|
+
let(:opts) { {} }
|
6
6
|
|
7
|
-
subject { described_class.new(opts) }
|
7
|
+
subject { described_class.new(**opts) }
|
8
8
|
|
9
9
|
context "default" do
|
10
10
|
it "has a cookbook version_class" do
|
@@ -4,8 +4,9 @@ module Berkshelf
|
|
4
4
|
describe Source do
|
5
5
|
let(:berksfile) { double("Berksfile", filepath: "/test/Berksfile") }
|
6
6
|
let(:arguments) { [] }
|
7
|
+
let(:kwargs) { {} }
|
7
8
|
let(:config) { Config.new }
|
8
|
-
subject(:instance) { described_class.new(berksfile, *arguments) }
|
9
|
+
subject(:instance) { described_class.new(berksfile, *arguments, **kwargs) }
|
9
10
|
before do
|
10
11
|
allow(Berkshelf::Config).to receive(:instance).and_return(config)
|
11
12
|
end
|
@@ -19,7 +20,8 @@ module Berkshelf
|
|
19
20
|
end
|
20
21
|
|
21
22
|
context "with a string argument and options" do
|
22
|
-
let(:arguments) { ["https://example.com"
|
23
|
+
let(:arguments) { ["https://example.com" ] }
|
24
|
+
let(:kwargs) { { key: "value" } }
|
23
25
|
it { is_expected.to eq :supermarket }
|
24
26
|
end
|
25
27
|
|
@@ -29,7 +31,8 @@ module Berkshelf
|
|
29
31
|
end
|
30
32
|
|
31
33
|
context "with a symbol argument and options" do
|
32
|
-
let(:arguments) { [:chef_server
|
34
|
+
let(:arguments) { [:chef_server ] }
|
35
|
+
let(:kwargs) { { key: "value" } }
|
33
36
|
it { is_expected.to eq :chef_server }
|
34
37
|
end
|
35
38
|
|
@@ -44,7 +47,8 @@ module Berkshelf
|
|
44
47
|
end
|
45
48
|
|
46
49
|
context "with a hash argument and disconnected options" do
|
47
|
-
let(:arguments) { [{ artifactory: "https://example.com/api/chef/chef-virtual" }
|
50
|
+
let(:arguments) { [{ artifactory: "https://example.com/api/chef/chef-virtual" }] }
|
51
|
+
let(:kwargs) { { key: "value" } }
|
48
52
|
it { is_expected.to eq :artifactory }
|
49
53
|
end
|
50
54
|
end
|
@@ -58,7 +62,8 @@ module Berkshelf
|
|
58
62
|
end
|
59
63
|
|
60
64
|
context "with a string argument and options" do
|
61
|
-
let(:arguments) { ["https://example.com"
|
65
|
+
let(:arguments) { ["https://example.com" ] }
|
66
|
+
let(:kwargs) { { key: "value" } }
|
62
67
|
it { is_expected.to eq "https://example.com" }
|
63
68
|
end
|
64
69
|
|
@@ -69,7 +74,8 @@ module Berkshelf
|
|
69
74
|
end
|
70
75
|
|
71
76
|
context "with a symbol argument and options" do
|
72
|
-
let(:arguments) { [:chef_server
|
77
|
+
let(:arguments) { [:chef_server] }
|
78
|
+
let(:kwargs) { { key: "value" } }
|
73
79
|
before { config.chef.chef_server_url = "https://chefserver/" }
|
74
80
|
it { is_expected.to eq "https://chefserver/" }
|
75
81
|
end
|
@@ -85,7 +91,8 @@ module Berkshelf
|
|
85
91
|
end
|
86
92
|
|
87
93
|
context "with a hash argument and disconnected options" do
|
88
|
-
let(:arguments) { [{ artifactory: "https://example.com/api/chef/chef-virtual" }
|
94
|
+
let(:arguments) { [{ artifactory: "https://example.com/api/chef/chef-virtual" } ] }
|
95
|
+
let(:kwargs) { { key: "value" } }
|
89
96
|
it { is_expected.to eq "https://example.com/api/chef/chef-virtual" }
|
90
97
|
end
|
91
98
|
|
@@ -96,7 +103,7 @@ module Berkshelf
|
|
96
103
|
|
97
104
|
context "with a chef_repo source" do
|
98
105
|
let(:arguments) { [{ chef_repo: "." }] }
|
99
|
-
it { is_expected.to eq(windows? ? "file://
|
106
|
+
it { is_expected.to eq(windows? ? "file://D/test" : "file:///test") }
|
100
107
|
end
|
101
108
|
end
|
102
109
|
|
@@ -110,16 +117,17 @@ module Berkshelf
|
|
110
117
|
# Check all baseline values.
|
111
118
|
its([:timeout]) { is_expected.to eq 30 }
|
112
119
|
its([:open_timeout]) { is_expected.to eq 3 }
|
113
|
-
its(
|
114
|
-
its(
|
115
|
-
its(
|
116
|
-
its(
|
117
|
-
its(
|
118
|
-
its(
|
120
|
+
its(%i{ssl verify}) { is_expected.to be true }
|
121
|
+
its(%i{ssl ca_file}) { is_expected.to be_nil }
|
122
|
+
its(%i{ssl ca_path}) { is_expected.to be_nil }
|
123
|
+
its(%i{ssl client_cert}) { is_expected.to be_nil }
|
124
|
+
its(%i{ssl client_key}) { is_expected.to be_nil }
|
125
|
+
its(%i{ssl cert_store}) { is_expected.to be_a(OpenSSL::X509::Store) }
|
119
126
|
end
|
120
127
|
|
121
128
|
context "with a string argument and options" do
|
122
|
-
let(:arguments) { ["https://example.com"
|
129
|
+
let(:arguments) { ["https://example.com"] }
|
130
|
+
let(:kwargs) { { key: "value" } }
|
123
131
|
its([:key]) { is_expected.to eq "value" }
|
124
132
|
end
|
125
133
|
|
@@ -129,7 +137,8 @@ module Berkshelf
|
|
129
137
|
end
|
130
138
|
|
131
139
|
context "with a symbol argument and options" do
|
132
|
-
let(:arguments) { [:chef_server
|
140
|
+
let(:arguments) { [:chef_server] }
|
141
|
+
let(:kwargs) { { key: "value" } }
|
133
142
|
its([:key]) { is_expected.to eq "value" }
|
134
143
|
end
|
135
144
|
|
@@ -144,7 +153,8 @@ module Berkshelf
|
|
144
153
|
end
|
145
154
|
|
146
155
|
context "with a hash argument and disconnected options" do
|
147
|
-
let(:arguments) { [{ artifactory: "https://example.com/api/chef/chef-virtual" }
|
156
|
+
let(:arguments) { [{ artifactory: "https://example.com/api/chef/chef-virtual" } ] }
|
157
|
+
let(:kwargs) { { key: "value" } }
|
148
158
|
its([:key]) { is_expected.to eq "value" }
|
149
159
|
end
|
150
160
|
|
@@ -156,7 +166,7 @@ module Berkshelf
|
|
156
166
|
|
157
167
|
context "with a chef_repo source" do
|
158
168
|
let(:arguments) { [{ chef_repo: "." }] }
|
159
|
-
its([:path]) { is_expected.to eq(windows? ? "
|
169
|
+
its([:path]) { is_expected.to eq(windows? ? "D:/test" : "/test") }
|
160
170
|
end
|
161
171
|
end
|
162
172
|
|
@@ -198,7 +208,8 @@ module Berkshelf
|
|
198
208
|
[
|
199
209
|
APIClient::RemoteCookbook.new("cb1", "1.0.8"),
|
200
210
|
APIClient::RemoteCookbook.new("cb1", "1.0.22"),
|
201
|
-
]
|
211
|
+
]
|
212
|
+
end
|
202
213
|
|
203
214
|
before do
|
204
215
|
allow_any_instance_of(APIClient::Connection).to receive(:universe).and_return(cookbooks)
|
@@ -16,19 +16,17 @@ describe Berkshelf::SSLPolicy do
|
|
16
16
|
cookbook_copyright: "user",
|
17
17
|
cookbook_email: "user@example.com",
|
18
18
|
cookbook_license: "apachev2",
|
19
|
-
trusted_certs_dir: self_signed_crt_path
|
20
|
-
)
|
19
|
+
trusted_certs_dir: self_signed_crt_path)
|
21
20
|
end
|
22
21
|
|
23
22
|
let(:berkshelf_config) do
|
24
23
|
double(Berkshelf::Config,
|
25
24
|
ssl: double(verify: true),
|
26
|
-
chef: chef_config
|
27
|
-
)
|
25
|
+
chef: chef_config)
|
28
26
|
end
|
29
27
|
|
30
28
|
subject do
|
31
|
-
Berkshelf::SSLPolicy.new
|
29
|
+
Berkshelf::SSLPolicy.new
|
32
30
|
end
|
33
31
|
|
34
32
|
before do
|
@@ -75,7 +73,6 @@ describe Berkshelf::SSLPolicy do
|
|
75
73
|
before do
|
76
74
|
allow(chef_config).to receive_messages(trusted_certs_dir: self_signed_crt_path_windows_backslashes)
|
77
75
|
allow(File).to receive(:exist?).with(self_signed_crt_path_windows_forwardslashes).and_return(true)
|
78
|
-
allow(Dir).to receive(:chdir).with(self_signed_crt_path_windows_forwardslashes)
|
79
76
|
end
|
80
77
|
|
81
78
|
it "replaces the backslashes in trusted_certs_dir from Berkshelf config with forwardslashes" do
|
@@ -5,14 +5,12 @@ module Berkshelf
|
|
5
5
|
let(:berksfile) do
|
6
6
|
double(Berksfile,
|
7
7
|
lockfile: lockfile,
|
8
|
-
dependencies: []
|
9
|
-
)
|
8
|
+
dependencies: [])
|
10
9
|
end
|
11
10
|
|
12
11
|
let(:lockfile) do
|
13
12
|
double(Lockfile,
|
14
|
-
graph: graph
|
15
|
-
)
|
13
|
+
graph: graph)
|
16
14
|
end
|
17
15
|
|
18
16
|
let(:graph) { double(Lockfile::Graph, locks: {}) }
|
@@ -48,7 +46,7 @@ module Berkshelf
|
|
48
46
|
end
|
49
47
|
|
50
48
|
describe "#run" do
|
51
|
-
let(:options) {
|
49
|
+
let(:options) { {} }
|
52
50
|
|
53
51
|
let(:chef_config) do
|
54
52
|
double(Berkshelf::ChefConfigCompat,
|
@@ -61,15 +59,13 @@ module Berkshelf
|
|
61
59
|
cookbook_copyright: "user",
|
62
60
|
cookbook_email: "user@example.com",
|
63
61
|
cookbook_license: "apachev2",
|
64
|
-
trusted_certs_dir: self_signed_crt_path
|
65
|
-
)
|
62
|
+
trusted_certs_dir: self_signed_crt_path)
|
66
63
|
end
|
67
64
|
|
68
65
|
let(:berkshelf_config) do
|
69
66
|
double(Config,
|
70
67
|
ssl: double(verify: true),
|
71
|
-
chef: chef_config
|
72
|
-
)
|
68
|
+
chef: chef_config)
|
73
69
|
end
|
74
70
|
|
75
71
|
let(:default_ridley_options) do
|
@@ -211,7 +207,7 @@ module Berkshelf
|
|
211
207
|
subject { described_class.new(berksfile).send(:lookup_dependencies, "runit") }
|
212
208
|
|
213
209
|
it "returns array of cookbook's dependencies and their dependencies" do
|
214
|
-
expect(subject).to eq
|
210
|
+
expect(subject).to eq %w{build-essential yum yum-epel}
|
215
211
|
end
|
216
212
|
end
|
217
213
|
end
|
@@ -4,10 +4,6 @@ describe Berkshelf::Validator do
|
|
4
4
|
describe "#validate_files" do
|
5
5
|
let(:cookbook) { double("cookbook", cookbook_name: "cookbook", path: "path") }
|
6
6
|
|
7
|
-
before do
|
8
|
-
allow(Dir).to receive(:chdir) { |&block| block.call }
|
9
|
-
end
|
10
|
-
|
11
7
|
it "raises an error when the cookbook has spaces in the files" do
|
12
8
|
allow(Dir).to receive(:glob).and_return(["/there are/spaces/in this/recipes/default.rb"])
|
13
9
|
expect do
|
@@ -21,14 +17,5 @@ describe Berkshelf::Validator do
|
|
21
17
|
subject.validate_files(cookbook)
|
22
18
|
end.to_not raise_error
|
23
19
|
end
|
24
|
-
|
25
|
-
it "does not raise an exception with spaces in the path" do
|
26
|
-
allow(Dir).to receive(:glob).and_return(["/there are/spaces/in this/recipes/default.rb"])
|
27
|
-
allow_any_instance_of(Pathname).to receive(:dirname).and_return("/there are/spaces/in this")
|
28
|
-
|
29
|
-
expect do
|
30
|
-
subject.validate_files(cookbook)
|
31
|
-
end.to_not raise_error
|
32
|
-
end
|
33
20
|
end
|
34
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: berkshelf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0
|
4
|
+
version: 7.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Winsor
|
@@ -9,25 +9,31 @@ authors:
|
|
9
9
|
- Michael Ivey
|
10
10
|
- Justin Campbell
|
11
11
|
- Seth Vargo
|
12
|
-
autorequire:
|
12
|
+
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2021-02-12 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: mixlib-shellout
|
19
19
|
requirement: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- - "
|
21
|
+
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: '2.0'
|
24
|
+
- - "<"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.0'
|
24
27
|
type: :runtime
|
25
28
|
prerelease: false
|
26
29
|
version_requirements: !ruby/object:Gem::Requirement
|
27
30
|
requirements:
|
28
|
-
- - "
|
31
|
+
- - ">="
|
29
32
|
- !ruby/object:Gem::Version
|
30
33
|
version: '2.0'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '4.0'
|
31
37
|
- !ruby/object:Gem::Dependency
|
32
38
|
name: cleanroom
|
33
39
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,16 +66,22 @@ dependencies:
|
|
60
66
|
name: retryable
|
61
67
|
requirement: !ruby/object:Gem::Requirement
|
62
68
|
requirements:
|
63
|
-
- - "
|
69
|
+
- - ">="
|
64
70
|
- !ruby/object:Gem::Version
|
65
71
|
version: '2.0'
|
72
|
+
- - "<"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '4.0'
|
66
75
|
type: :runtime
|
67
76
|
prerelease: false
|
68
77
|
version_requirements: !ruby/object:Gem::Requirement
|
69
78
|
requirements:
|
70
|
-
- - "
|
79
|
+
- - ">="
|
71
80
|
- !ruby/object:Gem::Version
|
72
81
|
version: '2.0'
|
82
|
+
- - "<"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '4.0'
|
73
85
|
- !ruby/object:Gem::Dependency
|
74
86
|
name: solve
|
75
87
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,16 +128,22 @@ dependencies:
|
|
116
128
|
name: mixlib-archive
|
117
129
|
requirement: !ruby/object:Gem::Requirement
|
118
130
|
requirements:
|
119
|
-
- - "
|
131
|
+
- - ">="
|
120
132
|
- !ruby/object:Gem::Version
|
121
|
-
version:
|
133
|
+
version: 1.1.4
|
134
|
+
- - "<"
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '2.0'
|
122
137
|
type: :runtime
|
123
138
|
prerelease: false
|
124
139
|
version_requirements: !ruby/object:Gem::Requirement
|
125
140
|
requirements:
|
126
|
-
- - "
|
141
|
+
- - ">="
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: 1.1.4
|
144
|
+
- - "<"
|
127
145
|
- !ruby/object:Gem::Version
|
128
|
-
version: '0
|
146
|
+
version: '2.0'
|
129
147
|
- !ruby/object:Gem::Dependency
|
130
148
|
name: concurrent-ruby
|
131
149
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,14 +164,14 @@ dependencies:
|
|
146
164
|
requirements:
|
147
165
|
- - ">="
|
148
166
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
167
|
+
version: 15.7.32
|
150
168
|
type: :runtime
|
151
169
|
prerelease: false
|
152
170
|
version_requirements: !ruby/object:Gem::Requirement
|
153
171
|
requirements:
|
154
172
|
- - ">="
|
155
173
|
- !ruby/object:Gem::Version
|
156
|
-
version:
|
174
|
+
version: 15.7.32
|
157
175
|
- !ruby/object:Gem::Dependency
|
158
176
|
name: chef-config
|
159
177
|
requirement: !ruby/object:Gem::Requirement
|
@@ -182,7 +200,7 @@ dependencies:
|
|
182
200
|
- - ">="
|
183
201
|
- !ruby/object:Gem::Version
|
184
202
|
version: 2.2.5
|
185
|
-
description: Manages a
|
203
|
+
description: Manages a Chef cookbook's dependencies
|
186
204
|
email:
|
187
205
|
- jamie@vialstudios.com
|
188
206
|
- jkiehl@riotgames.com
|
@@ -194,60 +212,11 @@ executables:
|
|
194
212
|
extensions: []
|
195
213
|
extra_rdoc_files: []
|
196
214
|
files:
|
197
|
-
- ".github/lock.yml"
|
198
|
-
- ".gitignore"
|
199
|
-
- ".rubocop.yml"
|
200
|
-
- ".travis.yml"
|
201
|
-
- CHANGELOG.legacy.md
|
202
|
-
- CHANGELOG.md
|
203
|
-
- CONTRIBUTING.md
|
204
215
|
- Gemfile
|
205
|
-
- Gemfile.lock
|
206
216
|
- LICENSE
|
207
|
-
- PLUGINS.md
|
208
|
-
- README.md
|
209
217
|
- Rakefile
|
210
|
-
- Thorfile
|
211
|
-
- appveyor.yml
|
212
218
|
- berkshelf.gemspec
|
213
219
|
- bin/berks
|
214
|
-
- docs/berkshelf_for_newcomers.md
|
215
|
-
- features/artifactory.feature
|
216
|
-
- features/berksfile.feature
|
217
|
-
- features/commands/apply.feature
|
218
|
-
- features/commands/contingent.feature
|
219
|
-
- features/commands/info.feature
|
220
|
-
- features/commands/install.feature
|
221
|
-
- features/commands/list.feature
|
222
|
-
- features/commands/outdated.feature
|
223
|
-
- features/commands/package.feature
|
224
|
-
- features/commands/search.feature
|
225
|
-
- features/commands/shelf/list.feature
|
226
|
-
- features/commands/shelf/show.feature
|
227
|
-
- features/commands/shelf/uninstall.feature
|
228
|
-
- features/commands/show.feature
|
229
|
-
- features/commands/update.feature
|
230
|
-
- features/commands/upload.feature
|
231
|
-
- features/commands/vendor.feature
|
232
|
-
- features/commands/verify.feature
|
233
|
-
- features/commands/viz.feature
|
234
|
-
- features/community_site.feature
|
235
|
-
- features/help.feature
|
236
|
-
- features/json_formatter.feature
|
237
|
-
- features/lifecycle.feature
|
238
|
-
- features/lockfile.feature
|
239
|
-
- features/step_definitions/berksfile_steps.rb
|
240
|
-
- features/step_definitions/chef/config_steps.rb
|
241
|
-
- features/step_definitions/chef_server_steps.rb
|
242
|
-
- features/step_definitions/cli_steps.rb
|
243
|
-
- features/step_definitions/config_steps.rb
|
244
|
-
- features/step_definitions/environment_steps.rb
|
245
|
-
- features/step_definitions/filesystem_steps.rb
|
246
|
-
- features/step_definitions/gem_steps.rb
|
247
|
-
- features/step_definitions/json_steps.rb
|
248
|
-
- features/step_definitions/utility_steps.rb
|
249
|
-
- features/support/aruba.rb
|
250
|
-
- features/support/env.rb
|
251
220
|
- lib/berkshelf.rb
|
252
221
|
- lib/berkshelf/api-client.rb
|
253
222
|
- lib/berkshelf/api_client.rb
|
@@ -326,8 +295,6 @@ files:
|
|
326
295
|
- spec/fixtures/cookbooks/example_cookbook-0.5.0/README.md
|
327
296
|
- spec/fixtures/cookbooks/example_cookbook-0.5.0/metadata.rb
|
328
297
|
- spec/fixtures/cookbooks/example_cookbook-0.5.0/recipes/default.rb
|
329
|
-
- spec/fixtures/cookbooks/example_cookbook/.gitignore
|
330
|
-
- spec/fixtures/cookbooks/example_cookbook/.kitchen.yml
|
331
298
|
- spec/fixtures/cookbooks/example_cookbook/Berksfile
|
332
299
|
- spec/fixtures/cookbooks/example_cookbook/Berksfile.lock
|
333
300
|
- spec/fixtures/cookbooks/example_cookbook/README.md
|
@@ -388,11 +355,11 @@ files:
|
|
388
355
|
- spec/unit/berkshelf/validator_spec.rb
|
389
356
|
- spec/unit/berkshelf/visualizer_spec.rb
|
390
357
|
- spec/unit/berkshelf_spec.rb
|
391
|
-
homepage:
|
358
|
+
homepage: https://docs.chef.io/berkshelf.html
|
392
359
|
licenses:
|
393
|
-
- Apache
|
360
|
+
- Apache-2.0
|
394
361
|
metadata: {}
|
395
|
-
post_install_message:
|
362
|
+
post_install_message:
|
396
363
|
rdoc_options: []
|
397
364
|
require_paths:
|
398
365
|
- lib
|
@@ -407,129 +374,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
407
374
|
- !ruby/object:Gem::Version
|
408
375
|
version: 2.0.0
|
409
376
|
requirements: []
|
410
|
-
|
411
|
-
|
412
|
-
signing_key:
|
377
|
+
rubygems_version: 3.1.4
|
378
|
+
signing_key:
|
413
379
|
specification_version: 4
|
414
|
-
summary: Manages a
|
415
|
-
test_files:
|
416
|
-
- features/artifactory.feature
|
417
|
-
- features/berksfile.feature
|
418
|
-
- features/commands/apply.feature
|
419
|
-
- features/commands/contingent.feature
|
420
|
-
- features/commands/info.feature
|
421
|
-
- features/commands/install.feature
|
422
|
-
- features/commands/list.feature
|
423
|
-
- features/commands/outdated.feature
|
424
|
-
- features/commands/package.feature
|
425
|
-
- features/commands/search.feature
|
426
|
-
- features/commands/shelf/list.feature
|
427
|
-
- features/commands/shelf/show.feature
|
428
|
-
- features/commands/shelf/uninstall.feature
|
429
|
-
- features/commands/show.feature
|
430
|
-
- features/commands/update.feature
|
431
|
-
- features/commands/upload.feature
|
432
|
-
- features/commands/vendor.feature
|
433
|
-
- features/commands/verify.feature
|
434
|
-
- features/commands/viz.feature
|
435
|
-
- features/community_site.feature
|
436
|
-
- features/help.feature
|
437
|
-
- features/json_formatter.feature
|
438
|
-
- features/lifecycle.feature
|
439
|
-
- features/lockfile.feature
|
440
|
-
- features/step_definitions/berksfile_steps.rb
|
441
|
-
- features/step_definitions/chef/config_steps.rb
|
442
|
-
- features/step_definitions/chef_server_steps.rb
|
443
|
-
- features/step_definitions/cli_steps.rb
|
444
|
-
- features/step_definitions/config_steps.rb
|
445
|
-
- features/step_definitions/environment_steps.rb
|
446
|
-
- features/step_definitions/filesystem_steps.rb
|
447
|
-
- features/step_definitions/gem_steps.rb
|
448
|
-
- features/step_definitions/json_steps.rb
|
449
|
-
- features/step_definitions/utility_steps.rb
|
450
|
-
- features/support/aruba.rb
|
451
|
-
- features/support/env.rb
|
452
|
-
- spec/config/berkshelf.pem
|
453
|
-
- spec/config/knife.rb
|
454
|
-
- spec/config/validator.pem
|
455
|
-
- spec/data/trusted_certs/example.crt
|
456
|
-
- spec/fixtures/Berksfile
|
457
|
-
- spec/fixtures/berksfiles/default
|
458
|
-
- spec/fixtures/complex-cookbook-path/cookbooks/app/metadata.rb
|
459
|
-
- spec/fixtures/complex-cookbook-path/cookbooks/jenkins-config/metadata.rb
|
460
|
-
- spec/fixtures/complex-cookbook-path/cookbooks/jenkins/metadata.rb
|
461
|
-
- spec/fixtures/cookbook-path-uploader/apt-2.3.6/metadata.rb
|
462
|
-
- spec/fixtures/cookbook-path-uploader/build-essential-1.4.2/metadata.rb
|
463
|
-
- spec/fixtures/cookbook-path-uploader/jenkins-2.0.3/metadata.rb
|
464
|
-
- spec/fixtures/cookbook-path-uploader/jenkins-config-0.1.0/metadata.rb
|
465
|
-
- spec/fixtures/cookbook-path-uploader/runit-1.5.8/metadata.rb
|
466
|
-
- spec/fixtures/cookbook-path-uploader/yum-3.0.6/metadata.rb
|
467
|
-
- spec/fixtures/cookbook-path-uploader/yum-epel-0.2.0/metadata.rb
|
468
|
-
- spec/fixtures/cookbook-path/jenkins-config/metadata.rb
|
469
|
-
- spec/fixtures/cookbook-store/jenkins-2.0.3/metadata.rb
|
470
|
-
- spec/fixtures/cookbook-store/jenkins-2.0.4/metadata.rb
|
471
|
-
- spec/fixtures/cookbooks/example_cookbook-0.5.0/README.md
|
472
|
-
- spec/fixtures/cookbooks/example_cookbook-0.5.0/metadata.rb
|
473
|
-
- spec/fixtures/cookbooks/example_cookbook-0.5.0/recipes/default.rb
|
474
|
-
- spec/fixtures/cookbooks/example_cookbook/.gitignore
|
475
|
-
- spec/fixtures/cookbooks/example_cookbook/.kitchen.yml
|
476
|
-
- spec/fixtures/cookbooks/example_cookbook/Berksfile
|
477
|
-
- spec/fixtures/cookbooks/example_cookbook/Berksfile.lock
|
478
|
-
- spec/fixtures/cookbooks/example_cookbook/README.md
|
479
|
-
- spec/fixtures/cookbooks/example_cookbook/metadata.rb
|
480
|
-
- spec/fixtures/cookbooks/example_cookbook/recipes/default.rb
|
481
|
-
- spec/fixtures/lockfiles/2.0.lock
|
482
|
-
- spec/fixtures/lockfiles/blank.lock
|
483
|
-
- spec/fixtures/lockfiles/default.lock
|
484
|
-
- spec/fixtures/lockfiles/empty.lock
|
485
|
-
- spec/fixtures/lockfiles/orphans.lock
|
486
|
-
- spec/spec_helper.rb
|
487
|
-
- spec/support/chef_api.rb
|
488
|
-
- spec/support/chef_server.rb
|
489
|
-
- spec/support/git.rb
|
490
|
-
- spec/support/kitchen.rb
|
491
|
-
- spec/support/matchers/file_system_matchers.rb
|
492
|
-
- spec/support/matchers/filepath_matchers.rb
|
493
|
-
- spec/support/path_helpers.rb
|
494
|
-
- spec/support/shared_examples/formatter.rb
|
495
|
-
- spec/unit/berkshelf/berksfile_spec.rb
|
496
|
-
- spec/unit/berkshelf/berkshelf/api_client/connection_spec.rb
|
497
|
-
- spec/unit/berkshelf/berkshelf/api_client/remote_cookbook_spec.rb
|
498
|
-
- spec/unit/berkshelf/berkshelf/api_client_spec.rb
|
499
|
-
- spec/unit/berkshelf/cached_cookbook_spec.rb
|
500
|
-
- spec/unit/berkshelf/chef_repo_universe_spec.rb
|
501
|
-
- spec/unit/berkshelf/cli_spec.rb
|
502
|
-
- spec/unit/berkshelf/community_rest_spec.rb
|
503
|
-
- spec/unit/berkshelf/config_spec.rb
|
504
|
-
- spec/unit/berkshelf/cookbook_store_spec.rb
|
505
|
-
- spec/unit/berkshelf/core_ext/file_utils_spec.rb
|
506
|
-
- spec/unit/berkshelf/core_ext/pathname_spec.rb
|
507
|
-
- spec/unit/berkshelf/dependency_spec.rb
|
508
|
-
- spec/unit/berkshelf/downloader_spec.rb
|
509
|
-
- spec/unit/berkshelf/errors_spec.rb
|
510
|
-
- spec/unit/berkshelf/file_syncer_spec.rb
|
511
|
-
- spec/unit/berkshelf/formatters/base_spec.rb
|
512
|
-
- spec/unit/berkshelf/formatters/human_spec.rb
|
513
|
-
- spec/unit/berkshelf/formatters/json_spec.rb
|
514
|
-
- spec/unit/berkshelf/formatters/null_spec.rb
|
515
|
-
- spec/unit/berkshelf/installer_spec.rb
|
516
|
-
- spec/unit/berkshelf/location_spec.rb
|
517
|
-
- spec/unit/berkshelf/locations/base_spec.rb
|
518
|
-
- spec/unit/berkshelf/locations/git_spec.rb
|
519
|
-
- spec/unit/berkshelf/locations/path_spec.rb
|
520
|
-
- spec/unit/berkshelf/lockfile_parser_spec.rb
|
521
|
-
- spec/unit/berkshelf/lockfile_spec.rb
|
522
|
-
- spec/unit/berkshelf/logger_spec.rb
|
523
|
-
- spec/unit/berkshelf/mixin/logging_spec.rb
|
524
|
-
- spec/unit/berkshelf/packager_spec.rb
|
525
|
-
- spec/unit/berkshelf/resolver/graph_spec.rb
|
526
|
-
- spec/unit/berkshelf/resolver_spec.rb
|
527
|
-
- spec/unit/berkshelf/ridley_compat_spec.rb
|
528
|
-
- spec/unit/berkshelf/shell_spec.rb
|
529
|
-
- spec/unit/berkshelf/source_spec.rb
|
530
|
-
- spec/unit/berkshelf/source_uri_spec.rb
|
531
|
-
- spec/unit/berkshelf/ssl_policies_spec.rb
|
532
|
-
- spec/unit/berkshelf/uploader_spec.rb
|
533
|
-
- spec/unit/berkshelf/validator_spec.rb
|
534
|
-
- spec/unit/berkshelf/visualizer_spec.rb
|
535
|
-
- spec/unit/berkshelf_spec.rb
|
380
|
+
summary: Manages a Chef cookbook's dependencies
|
381
|
+
test_files: []
|