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
@@ -1,19 +1,31 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: Listing cookbooks defined by a Berksfile
|
2
2
|
As a user with a Berksfile
|
3
3
|
I want a way to show all my cookbooks and their versions without opening my Berksfile
|
4
4
|
So that I can be more productive
|
5
5
|
|
6
6
|
Scenario: Running the list command
|
7
|
+
Given the cookbook store has the cookbooks:
|
8
|
+
| fake1 | 1.0.0 |
|
9
|
+
| fake2 | 1.0.1 |
|
7
10
|
Given I write to "Berksfile" with:
|
8
11
|
"""
|
9
|
-
cookbook '
|
10
|
-
cookbook '
|
12
|
+
cookbook 'fake1', '1.0.0'
|
13
|
+
cookbook 'fake2', '1.0.1'
|
11
14
|
"""
|
12
15
|
When I successfully run `berks list`
|
13
16
|
Then the output should contain:
|
14
17
|
"""
|
15
18
|
Cookbooks installed by your Berksfile:
|
16
|
-
*
|
17
|
-
*
|
19
|
+
* fake1 (1.0.0)
|
20
|
+
* fake2 (1.0.1)
|
21
|
+
"""
|
22
|
+
And the exit status should be 0
|
23
|
+
|
24
|
+
Scenario: Running the list command with no sources defined
|
25
|
+
Given an empty file named "Berksfile"
|
26
|
+
When I successfully run `berks list`
|
27
|
+
Then the output should contain:
|
28
|
+
"""
|
29
|
+
There are no cookbooks installed by your Berksfile
|
18
30
|
"""
|
19
31
|
And the exit status should be 0
|
data/features/lockfile.feature
CHANGED
@@ -1,21 +1,22 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: Creating and reading the Berkshelf lockfile
|
2
2
|
As a user
|
3
3
|
I want my versions to be locked even when I don't specify versions in my Berksfile
|
4
4
|
So when I share my repository, all other developers get the same versions that I did when I installed.
|
5
5
|
|
6
6
|
Scenario: Writing the Berksfile.lock
|
7
|
-
Given
|
7
|
+
Given the cookbook store has the cookbooks:
|
8
|
+
| fake | 1.0.0 |
|
9
|
+
And I write to "Berksfile" with:
|
8
10
|
"""
|
9
|
-
|
10
|
-
cookbook 'berkshelf-cookbook-fixture', '1.0.0'
|
11
|
+
cookbook 'fake', '1.0.0'
|
11
12
|
"""
|
12
13
|
When I successfully run `berks install`
|
13
14
|
Then the file "Berksfile.lock" should contain JSON:
|
14
15
|
"""
|
15
16
|
{
|
16
|
-
"sha":"
|
17
|
+
"sha":"80396ed07db133e0192593adebb360c27eed88c2",
|
17
18
|
"sources":{
|
18
|
-
"
|
19
|
+
"fake":{
|
19
20
|
"constraint":"= 1.0.0",
|
20
21
|
"locked_version":"1.0.0"
|
21
22
|
}
|
@@ -23,34 +24,89 @@ Feature: Berksfile.lock
|
|
23
24
|
}
|
24
25
|
"""
|
25
26
|
|
27
|
+
Scenario: Wiring the Berksfile.lock when an old lockfile is present
|
28
|
+
Given the cookbook store has the cookbooks:
|
29
|
+
| fake | 1.0.0 |
|
30
|
+
And I write to "Berksfile" with:
|
31
|
+
"""
|
32
|
+
cookbook 'fake', '1.0.0'
|
33
|
+
"""
|
34
|
+
And I write to "Berksfile.lock" with:
|
35
|
+
"""
|
36
|
+
cookbook 'fake', :locked_version => '1.0.0'
|
37
|
+
"""
|
38
|
+
When I successfully run `berks install`
|
39
|
+
Then the output should contain "You are using the old lockfile format. Attempting to convert..."
|
40
|
+
Then the file "Berksfile.lock" should contain JSON:
|
41
|
+
"""
|
42
|
+
{
|
43
|
+
"sha":"80396ed07db133e0192593adebb360c27eed88c2",
|
44
|
+
"sources":{
|
45
|
+
"fake":{
|
46
|
+
"locked_version":"1.0.0",
|
47
|
+
"constraint":"= 1.0.0"
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
"""
|
52
|
+
|
53
|
+
Scenario: Writing the Berksfile.lock when an old lockfile is present and contains a full path
|
54
|
+
Given a cookbook named "fake"
|
55
|
+
And I write to "Berksfile" with:
|
56
|
+
"""
|
57
|
+
cookbook 'fake', '0.0.0', path: './fake'
|
58
|
+
"""
|
59
|
+
And I dynamically write to "Berksfile.lock" with:
|
60
|
+
"""
|
61
|
+
cookbook 'fake', :locked_version => '0.0.0', path: '<%= File.expand_path('tmp/aruba/fake') %>'
|
62
|
+
"""
|
63
|
+
When I successfully run `berks install`
|
64
|
+
Then the output should contain "You are using the old lockfile format. Attempting to convert..."
|
65
|
+
Then the file "Berksfile.lock" should contain JSON:
|
66
|
+
"""
|
67
|
+
{
|
68
|
+
"sha":"4b614de85168d72fda4b255fc31796b4c474c3fc",
|
69
|
+
"sources":{
|
70
|
+
"fake":{
|
71
|
+
"locked_version":"0.0.0",
|
72
|
+
"constraint":"= 0.0.0",
|
73
|
+
"path":"./fake"
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
"""
|
78
|
+
|
26
79
|
Scenario: Installing a cookbook with dependencies
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
""
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
"
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
"
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
"
|
46
|
-
|
80
|
+
Given the cookbook store has the cookbooks:
|
81
|
+
| dep | 1.0.0 |
|
82
|
+
And the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
|
83
|
+
| dep | ~> 1.0.0 |
|
84
|
+
And I write to "Berksfile" with:
|
85
|
+
"""
|
86
|
+
cookbook 'fake', '1.0.0'
|
87
|
+
"""
|
88
|
+
When I successfully run `berks install`
|
89
|
+
Then the file "Berksfile.lock" should contain JSON:
|
90
|
+
"""
|
91
|
+
{
|
92
|
+
"sha":"80396ed07db133e0192593adebb360c27eed88c2",
|
93
|
+
"sources":{
|
94
|
+
"fake":{
|
95
|
+
"constraint":"= 1.0.0",
|
96
|
+
"locked_version":"1.0.0"
|
97
|
+
},
|
98
|
+
"dep":{
|
99
|
+
"constraint":"~> 1.0.0",
|
100
|
+
"locked_version":"1.0.0"
|
101
|
+
}
|
47
102
|
}
|
48
103
|
}
|
49
|
-
|
50
|
-
"""
|
104
|
+
"""
|
51
105
|
|
52
106
|
Scenario: Writing the Berksfile.lock with a pessimistic lock
|
53
|
-
Given
|
107
|
+
Given the cookbook store has the cookbooks:
|
108
|
+
| berkshelf-cookbook-fixture | 1.0.0 |
|
109
|
+
And I write to "Berksfile" with:
|
54
110
|
"""
|
55
111
|
site :opscode
|
56
112
|
cookbook 'berkshelf-cookbook-fixture', '~> 1.0.0'
|
@@ -82,173 +138,234 @@ Feature: Berksfile.lock
|
|
82
138
|
"""
|
83
139
|
|
84
140
|
Scenario: Updating with a Berksfile.lock with pessimistic lock
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
"
|
95
|
-
|
96
|
-
|
97
|
-
|
141
|
+
Given the cookbook store has the cookbooks:
|
142
|
+
| berkshelf-cookbook-fixture | 0.2.0 |
|
143
|
+
| berkshelf-cookbook-fixture | 1.0.0 |
|
144
|
+
And I write to "Berksfile" with:
|
145
|
+
"""
|
146
|
+
site :opscode
|
147
|
+
cookbook 'berkshelf-cookbook-fixture', '~> 0.1'
|
148
|
+
"""
|
149
|
+
And I write to "Berksfile.lock" with:
|
150
|
+
"""
|
151
|
+
{
|
152
|
+
"sha":"3dced4fcd9c3f72b68e746190aaa1140bdc6cc3d",
|
153
|
+
"sources":{
|
154
|
+
"berkshelf-cookbook-fixture":{
|
155
|
+
"constraint":"~> 0.1",
|
156
|
+
"locked_version":"0.1.0"
|
157
|
+
}
|
98
158
|
}
|
99
159
|
}
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
160
|
+
"""
|
161
|
+
When I successfully run `berks update berkshelf-cookbook-fixture`
|
162
|
+
Then the file "Berksfile.lock" should contain JSON:
|
163
|
+
"""
|
164
|
+
{
|
165
|
+
"sha":"b2714a4f9bdf500cb20267067160a0b3c1d8404c",
|
166
|
+
"sources":{
|
167
|
+
"berkshelf-cookbook-fixture":{
|
168
|
+
"constraint":"~> 0.1",
|
169
|
+
"locked_version":"0.2.0"
|
170
|
+
}
|
111
171
|
}
|
112
172
|
}
|
113
|
-
|
114
|
-
"""
|
173
|
+
"""
|
115
174
|
|
116
175
|
Scenario: Updating with a Berksfile.lock with hard lock
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
"
|
126
|
-
|
127
|
-
"
|
128
|
-
|
129
|
-
"
|
176
|
+
Given the cookbook store has the cookbooks:
|
177
|
+
| berkshelf-cookbook-fixture | 1.0.0 |
|
178
|
+
And I write to "Berksfile" with:
|
179
|
+
"""
|
180
|
+
site :opscode
|
181
|
+
cookbook 'berkshelf-cookbook-fixture', '1.0.0'
|
182
|
+
"""
|
183
|
+
And I write to "Berksfile.lock" with:
|
184
|
+
"""
|
185
|
+
{
|
186
|
+
"sha":"7d07c22eca03bf6da5aaf38ae81cb9a8a439c692",
|
187
|
+
"sources":{
|
188
|
+
"berkshelf-cookbook-fixture":{
|
189
|
+
"constraint":"= 1.0.0",
|
190
|
+
"locked_version":"1.0.0"
|
191
|
+
}
|
130
192
|
}
|
131
193
|
}
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
194
|
+
"""
|
195
|
+
When I successfully run `berks update berkshelf-cookbook-fixture`
|
196
|
+
Then the file "Berksfile.lock" should contain JSON:
|
197
|
+
"""
|
198
|
+
{
|
199
|
+
"sha":"c6438d7590f4d695d8abae83ff22586ba6d3a52e",
|
200
|
+
"sources":{
|
201
|
+
"berkshelf-cookbook-fixture":{
|
202
|
+
"constraint":"= 1.0.0",
|
203
|
+
"locked_version":"1.0.0"
|
204
|
+
}
|
143
205
|
}
|
144
206
|
}
|
145
|
-
|
146
|
-
"""
|
207
|
+
"""
|
147
208
|
|
148
209
|
Scenario: Updating a Berksfile.lock with a git location
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
"
|
159
|
-
|
160
|
-
"
|
161
|
-
|
162
|
-
"
|
163
|
-
|
210
|
+
Given the cookbook store has the cookbooks:
|
211
|
+
| berkshelf-cookbook-fixture | 919afa0c402089df23ebdf36637f12271b8a96b4 |
|
212
|
+
And I write to "Berksfile" with:
|
213
|
+
"""
|
214
|
+
site :opscode
|
215
|
+
cookbook 'berkshelf-cookbook-fixture', git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git', ref: '919afa0c4'
|
216
|
+
"""
|
217
|
+
When I successfully run `berks install`
|
218
|
+
Then the file "Berksfile.lock" should contain JSON:
|
219
|
+
"""
|
220
|
+
{
|
221
|
+
"sha": "b8e06c891c824b3e3481df024eb241e1c02572a6",
|
222
|
+
"sources":{
|
223
|
+
"berkshelf-cookbook-fixture":{
|
224
|
+
"git":"git://github.com/RiotGames/berkshelf-cookbook-fixture.git",
|
225
|
+
"ref":"919afa0c402089df23ebdf36637f12271b8a96b4",
|
226
|
+
"locked_version":"1.0.0"
|
227
|
+
}
|
164
228
|
}
|
165
229
|
}
|
166
|
-
|
167
|
-
"""
|
230
|
+
"""
|
168
231
|
|
169
232
|
Scenario: Updating a Berksfile.lock with a git location and a branch
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
"
|
180
|
-
|
181
|
-
"
|
182
|
-
|
183
|
-
"
|
184
|
-
|
233
|
+
Given the cookbook store has the cookbooks:
|
234
|
+
| berkshelf-cookbook-fixture | master |
|
235
|
+
And I write to "Berksfile" with:
|
236
|
+
"""
|
237
|
+
site :opscode
|
238
|
+
cookbook 'berkshelf-cookbook-fixture', git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git', branch: 'master'
|
239
|
+
"""
|
240
|
+
When I successfully run `berks install`
|
241
|
+
Then the file "Berksfile.lock" should contain JSON:
|
242
|
+
"""
|
243
|
+
{
|
244
|
+
"sha": "310f95bb86ba76b47eef28abc621d0e8de19bbb6",
|
245
|
+
"sources":{
|
246
|
+
"berkshelf-cookbook-fixture":{
|
247
|
+
"git":"git://github.com/RiotGames/berkshelf-cookbook-fixture.git",
|
248
|
+
"ref":"a97b9447cbd41a5fe58eee2026e48ccb503bd3bc",
|
249
|
+
"locked_version":"1.0.0"
|
250
|
+
}
|
185
251
|
}
|
186
252
|
}
|
187
|
-
|
188
|
-
"""
|
253
|
+
"""
|
189
254
|
|
190
255
|
Scenario: Updating a Berksfile.lock with a git location and a branch
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
"
|
201
|
-
|
202
|
-
"
|
203
|
-
|
204
|
-
"
|
205
|
-
|
256
|
+
Given the cookbook store has the cookbooks:
|
257
|
+
| berkshelf-cookbook-fixture | 70a527e17d91f01f031204562460ad1c17f972ee |
|
258
|
+
And I write to "Berksfile" with:
|
259
|
+
"""
|
260
|
+
site :opscode
|
261
|
+
cookbook 'berkshelf-cookbook-fixture', git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git', tag: 'v0.2.0'
|
262
|
+
"""
|
263
|
+
When I successfully run `berks install`
|
264
|
+
Then the file "Berksfile.lock" should contain JSON:
|
265
|
+
"""
|
266
|
+
{
|
267
|
+
"sha": "ade51e222f569cc299f34ec1100d321f3b230c36",
|
268
|
+
"sources":{
|
269
|
+
"berkshelf-cookbook-fixture":{
|
270
|
+
"git":"git://github.com/RiotGames/berkshelf-cookbook-fixture.git",
|
271
|
+
"ref":"70a527e17d91f01f031204562460ad1c17f972ee",
|
272
|
+
"locked_version":"0.2.0"
|
273
|
+
}
|
206
274
|
}
|
207
275
|
}
|
208
|
-
|
209
|
-
"""
|
276
|
+
"""
|
210
277
|
|
211
278
|
Scenario: Updating a Berksfile.lock with a GitHub location
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
"
|
222
|
-
|
223
|
-
"
|
224
|
-
|
225
|
-
"
|
226
|
-
|
279
|
+
Given the cookbook store has the cookbooks:
|
280
|
+
| berkshelf-cookbook-fixture | 919afa0c402089df23ebdf36637f12271b8a96b4 |
|
281
|
+
And I write to "Berksfile" with:
|
282
|
+
"""
|
283
|
+
site :opscode
|
284
|
+
cookbook 'berkshelf-cookbook-fixture', github: 'RiotGames/berkshelf-cookbook-fixture', ref: '919afa0c4'
|
285
|
+
"""
|
286
|
+
When I successfully run `berks install`
|
287
|
+
Then the file "Berksfile.lock" should contain JSON:
|
288
|
+
"""
|
289
|
+
{
|
290
|
+
"sha": "3ac97aa503bcebb2b393410aebc176c3c5bed2d4",
|
291
|
+
"sources":{
|
292
|
+
"berkshelf-cookbook-fixture":{
|
293
|
+
"git":"git://github.com/RiotGames/berkshelf-cookbook-fixture.git",
|
294
|
+
"ref":"919afa0c402089df23ebdf36637f12271b8a96b4",
|
295
|
+
"locked_version":"1.0.0"
|
296
|
+
}
|
227
297
|
}
|
228
298
|
}
|
229
|
-
|
230
|
-
|
299
|
+
"""
|
300
|
+
|
301
|
+
Scenario: Updating a Berksfile.lock when a git location with :rel
|
302
|
+
Given I write to "Berksfile" with:
|
303
|
+
"""
|
304
|
+
site :opscode
|
305
|
+
cookbook 'berkshelf-cookbook-fixture', github: 'RiotGames/berkshelf-cookbook-fixture', branch: 'rel', rel: 'cookbooks/berkshelf-cookbook-fixture'
|
306
|
+
"""
|
307
|
+
When I successfully run `berks install`
|
308
|
+
Then the file "Berksfile.lock" should contain JSON:
|
309
|
+
"""
|
310
|
+
{
|
311
|
+
"sha": "f0b5a9c0230a3ff384badb0c40af1058cde75bee",
|
312
|
+
"sources":{
|
313
|
+
"berkshelf-cookbook-fixture":{
|
314
|
+
"git":"git://github.com/RiotGames/berkshelf-cookbook-fixture.git",
|
315
|
+
"ref":"93f5768b7d14df45e10d16c8bf6fe98ba3ff809a",
|
316
|
+
"rel":"cookbooks/berkshelf-cookbook-fixture",
|
317
|
+
"locked_version":"1.0.0"
|
318
|
+
}
|
319
|
+
}
|
320
|
+
}
|
321
|
+
"""
|
231
322
|
|
232
323
|
Scenario: Updating a Berksfile.lock with a path location
|
233
|
-
|
234
|
-
""
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
324
|
+
Given a cookbook named "fake"
|
325
|
+
And I write to "Berksfile" with:
|
326
|
+
"""
|
327
|
+
site :opscode
|
328
|
+
cookbook 'fake', path: './fake'
|
329
|
+
"""
|
330
|
+
When I successfully run `berks install`
|
331
|
+
Then the file "Berksfile.lock" should contain JSON:
|
332
|
+
"""
|
333
|
+
{
|
334
|
+
"sha": "42a13f91f1ba19ce8c6776fe267e74510dee27ce",
|
335
|
+
"sources":{
|
336
|
+
"fake":{
|
337
|
+
"path":"./fake",
|
338
|
+
"locked_version":"0.0.0"
|
339
|
+
}
|
340
|
+
}
|
341
|
+
}
|
342
|
+
"""
|
343
|
+
|
344
|
+
Scenario: Lockfile when `metadata` is specified
|
345
|
+
Given I write to "metadata.rb" with:
|
346
|
+
"""
|
347
|
+
name 'fake'
|
348
|
+
version '1.0.0'
|
349
|
+
"""
|
350
|
+
And I write to "Berksfile" with:
|
351
|
+
"""
|
352
|
+
site :opscode
|
353
|
+
metadata
|
354
|
+
"""
|
355
|
+
When I successfully run `berks install`
|
356
|
+
Then the file "Berksfile.lock" should contain JSON:
|
357
|
+
"""
|
358
|
+
{
|
359
|
+
"sha": "9e7f8da566fec49ac41c0d862cfdf728eee10568",
|
360
|
+
"sources":{
|
361
|
+
"fake":{
|
362
|
+
"path":".",
|
363
|
+
"locked_version":"1.0.0",
|
364
|
+
"constraint":"= 1.0.0"
|
365
|
+
}
|
248
366
|
}
|
249
367
|
}
|
250
|
-
|
251
|
-
"""
|
368
|
+
"""
|
252
369
|
|
253
370
|
Scenario: Updating a Berksfile.lock with a different site location
|
254
371
|
Given pending we have a reliable non-opscode site to test
|
@@ -271,27 +388,29 @@ Feature: Berksfile.lock
|
|
271
388
|
# """
|
272
389
|
|
273
390
|
Scenario: Installing when the locked version is no longer satisfied
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
391
|
+
Given the cookbook store has the cookbooks:
|
392
|
+
| berkshelf-cookbook-fixture | 1.0.0 |
|
393
|
+
Given I write to "Berksfile" with:
|
394
|
+
"""
|
395
|
+
site :opscode
|
396
|
+
cookbook 'berkshelf-cookbook-fixture', '1.0.0'
|
397
|
+
"""
|
398
|
+
And I successfully run `berks install`
|
399
|
+
And I write to "Berksfile" with:
|
400
|
+
"""
|
401
|
+
site :opscode
|
402
|
+
cookbook 'berkshelf-cookbook-fixture', '~> 1.3.0'
|
403
|
+
"""
|
404
|
+
When I run `berks install`
|
405
|
+
Then the output should contain:
|
406
|
+
"""
|
407
|
+
Berkshelf could not find compatible versions for cookbook 'berkshelf-cookbook-fixture':
|
408
|
+
In Berksfile:
|
409
|
+
berkshelf-cookbook-fixture (1.0.0)
|
291
410
|
|
292
|
-
|
293
|
-
|
411
|
+
In Berksfile.lock:
|
412
|
+
berkshelf-cookbook-fixture (~> 1.3.0)
|
294
413
|
|
295
|
-
|
296
|
-
|
297
|
-
|
414
|
+
Try running `berks update berkshelf-cookbook-fixture, which will try to find 'berkshelf-cookbook-fixture' matching '~> 1.3.0'
|
415
|
+
"""
|
416
|
+
And the CLI should exit with the status code for error "OutdatedCookbookSource"
|