berkshelf 7.0.7 → 7.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -3
  3. data/Rakefile +4 -4
  4. data/berkshelf.gemspec +10 -12
  5. data/bin/berks +5 -0
  6. data/lib/berkshelf.rb +8 -9
  7. data/lib/berkshelf/api_client/chef_server_connection.rb +3 -2
  8. data/lib/berkshelf/api_client/connection.rb +1 -1
  9. data/lib/berkshelf/api_client/remote_cookbook.rb +1 -1
  10. data/lib/berkshelf/berksfile.rb +41 -39
  11. data/lib/berkshelf/cached_cookbook.rb +6 -4
  12. data/lib/berkshelf/chef_config_compat.rb +2 -1
  13. data/lib/berkshelf/chef_repo_universe.rb +6 -4
  14. data/lib/berkshelf/cli.rb +6 -6
  15. data/lib/berkshelf/commands/shelf.rb +1 -1
  16. data/lib/berkshelf/community_rest.rb +6 -6
  17. data/lib/berkshelf/config.rb +3 -3
  18. data/lib/berkshelf/cookbook_store.rb +2 -4
  19. data/lib/berkshelf/core_ext.rb +1 -1
  20. data/lib/berkshelf/core_ext/file_utils.rb +3 -3
  21. data/lib/berkshelf/dependency.rb +1 -1
  22. data/lib/berkshelf/downloader.rb +9 -6
  23. data/lib/berkshelf/errors.rb +5 -2
  24. data/lib/berkshelf/file_syncer.rb +7 -12
  25. data/lib/berkshelf/formatters/human.rb +1 -1
  26. data/lib/berkshelf/formatters/json.rb +4 -4
  27. data/lib/berkshelf/installer.rb +1 -1
  28. data/lib/berkshelf/location.rb +3 -3
  29. data/lib/berkshelf/locations/git.rb +6 -12
  30. data/lib/berkshelf/lockfile.rb +14 -14
  31. data/lib/berkshelf/logger.rb +4 -2
  32. data/lib/berkshelf/mixin/git.rb +3 -3
  33. data/lib/berkshelf/packager.rb +5 -7
  34. data/lib/berkshelf/resolver.rb +1 -1
  35. data/lib/berkshelf/ridley_compat.rb +1 -1
  36. data/lib/berkshelf/shell.rb +2 -1
  37. data/lib/berkshelf/shell_out.rb +4 -3
  38. data/lib/berkshelf/source.rb +8 -7
  39. data/lib/berkshelf/source_uri.rb +1 -1
  40. data/lib/berkshelf/ssl_policies.rb +5 -9
  41. data/lib/berkshelf/thor.rb +1 -1
  42. data/lib/berkshelf/thor_ext.rb +1 -1
  43. data/lib/berkshelf/uploader.rb +11 -9
  44. data/lib/berkshelf/validator.rb +2 -8
  45. data/lib/berkshelf/version.rb +1 -1
  46. data/lib/berkshelf/visualizer.rb +3 -3
  47. data/spec/config/knife.rb +1 -1
  48. data/spec/spec_helper.rb +1 -1
  49. data/spec/support/chef_server.rb +2 -2
  50. data/spec/support/git.rb +18 -18
  51. data/spec/support/path_helpers.rb +4 -4
  52. data/spec/unit/berkshelf/berksfile_spec.rb +7 -7
  53. data/spec/unit/berkshelf/cli_spec.rb +1 -2
  54. data/spec/unit/berkshelf/community_rest_spec.rb +1 -1
  55. data/spec/unit/berkshelf/core_ext/file_utils_spec.rb +2 -2
  56. data/spec/unit/berkshelf/dependency_spec.rb +5 -5
  57. data/spec/unit/berkshelf/downloader_spec.rb +4 -8
  58. data/spec/unit/berkshelf/locations/base_spec.rb +1 -2
  59. data/spec/unit/berkshelf/locations/git_spec.rb +2 -5
  60. data/spec/unit/berkshelf/locations/path_spec.rb +1 -2
  61. data/spec/unit/berkshelf/lockfile_spec.rb +9 -18
  62. data/spec/unit/berkshelf/ridley_compat_spec.rb +2 -2
  63. data/spec/unit/berkshelf/source_spec.rb +30 -19
  64. data/spec/unit/berkshelf/ssl_policies_spec.rb +3 -6
  65. data/spec/unit/berkshelf/uploader_spec.rb +6 -10
  66. data/spec/unit/berkshelf/validator_spec.rb +0 -13
  67. metadata +39 -193
  68. data/.github/lock.yml +0 -1
  69. data/.gitignore +0 -30
  70. data/.rubocop.yml +0 -12
  71. data/.travis.yml +0 -73
  72. data/CHANGELOG.legacy.md +0 -307
  73. data/CHANGELOG.md +0 -1589
  74. data/CONTRIBUTING.md +0 -68
  75. data/Gemfile.lock +0 -292
  76. data/PLUGINS.md +0 -25
  77. data/README.md +0 -72
  78. data/Thorfile +0 -61
  79. data/appveyor.yml +0 -31
  80. data/docs/berkshelf_for_newcomers.md +0 -64
  81. data/features/artifactory.feature +0 -70
  82. data/features/berksfile.feature +0 -46
  83. data/features/commands/apply.feature +0 -41
  84. data/features/commands/contingent.feature +0 -47
  85. data/features/commands/info.feature +0 -141
  86. data/features/commands/install.feature +0 -646
  87. data/features/commands/list.feature +0 -78
  88. data/features/commands/outdated.feature +0 -176
  89. data/features/commands/package.feature +0 -17
  90. data/features/commands/search.feature +0 -17
  91. data/features/commands/shelf/list.feature +0 -32
  92. data/features/commands/shelf/show.feature +0 -113
  93. data/features/commands/shelf/uninstall.feature +0 -96
  94. data/features/commands/show.feature +0 -83
  95. data/features/commands/update.feature +0 -142
  96. data/features/commands/upload.feature +0 -499
  97. data/features/commands/vendor.feature +0 -154
  98. data/features/commands/verify.feature +0 -29
  99. data/features/commands/viz.feature +0 -66
  100. data/features/community_site.feature +0 -37
  101. data/features/help.feature +0 -11
  102. data/features/json_formatter.feature +0 -158
  103. data/features/lifecycle.feature +0 -378
  104. data/features/lockfile.feature +0 -378
  105. data/features/step_definitions/berksfile_steps.rb +0 -54
  106. data/features/step_definitions/chef/config_steps.rb +0 -12
  107. data/features/step_definitions/chef_server_steps.rb +0 -60
  108. data/features/step_definitions/cli_steps.rb +0 -18
  109. data/features/step_definitions/config_steps.rb +0 -46
  110. data/features/step_definitions/environment_steps.rb +0 -11
  111. data/features/step_definitions/filesystem_steps.rb +0 -286
  112. data/features/step_definitions/gem_steps.rb +0 -13
  113. data/features/step_definitions/json_steps.rb +0 -29
  114. data/features/step_definitions/utility_steps.rb +0 -11
  115. data/features/support/aruba.rb +0 -12
  116. data/features/support/env.rb +0 -77
  117. data/spec/fixtures/cookbooks/example_cookbook/.gitignore +0 -2
  118. data/spec/fixtures/cookbooks/example_cookbook/.kitchen.yml +0 -26
@@ -1,83 +0,0 @@
1
- Feature: berks show
2
- Scenario: With no options
3
- Given the cookbook store has the cookbooks:
4
- | fake | 1.0.0 |
5
- And I have a Berksfile pointing at the local Berkshelf API with:
6
- """
7
- cookbook 'fake', '1.0.0'
8
- """
9
- And I write to "Berksfile.lock" with:
10
- """
11
- DEPENDENCIES
12
- fake (= 1.0.0)
13
-
14
- GRAPH
15
- fake (1.0.0)
16
- """
17
- When I successfully run `berks show fake`
18
- Then the output should contain "cookbooks/fake-1.0.0"
19
-
20
- Scenario: When the parameter is a transitive dependency
21
- Given the cookbook store has the cookbooks:
22
- | dep | 1.0.0 |
23
- And the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
24
- | dep | ~> 1.0.0 |
25
- And I have a Berksfile pointing at the local Berkshelf API with:
26
- """
27
- cookbook 'fake', '1.0.0'
28
- """
29
- And I write to "Berksfile.lock" with:
30
- """
31
- DEPENDENCIES
32
- fake (= 1.0.0)
33
-
34
- GRAPH
35
- dep (1.0.0)
36
- fake (1.0.0)
37
- dep (~> 1.0.0)
38
- """
39
- And I successfully run `berks install`
40
- When I successfully run `berks show dep`
41
- Then the output should contain "cookbooks/dep-1.0.0"
42
-
43
- Scenario: When the cookbook is not in the Berksfile
44
- Given I have a Berksfile pointing at the local Berkshelf API
45
- When I run `berks show fake`
46
- Then the output should contain:
47
- """
48
- Dependency 'fake' was not found. Please make sure it is in your Berksfile, and then run `berks install` to download and install the missing dependencies.
49
- """
50
- And the exit status should be "DependencyNotFound"
51
-
52
- Scenario: When there is no lockfile present
53
- And I have a Berksfile pointing at the local Berkshelf API with:
54
- """
55
- cookbook 'fake', '1.0.0'
56
- """
57
- When I run `berks show fake`
58
- Then the output should contain:
59
- """
60
- Dependency 'fake' was not found. Please make sure it is in your Berksfile, and then run `berks install` to download and install the missing dependencies.
61
- """
62
- And the exit status should be "DependencyNotFound"
63
-
64
- Scenario: When the cookbook is not installed
65
- Given the cookbook store is empty
66
- And I have a Berksfile pointing at the local Berkshelf API with:
67
- """
68
- cookbook 'fake', '1.0.0'
69
- """
70
- And I write to "Berksfile.lock" with:
71
- """
72
- DEPENDENCIES
73
- fake (= 1.0.0)
74
-
75
- GRAPH
76
- fake (1.0.0)
77
- """
78
- When I run `berks show fake`
79
- Then the output should contain:
80
- """
81
- Cookbook 'fake' (1.0.0) not found in the cookbook store!
82
- """
83
- And the exit status should be "CookbookNotFound"
@@ -1,142 +0,0 @@
1
- @api_server
2
- Feature: berks update
3
- Background:
4
- * the cookbook store has the cookbooks:
5
- | fake | 0.1.0 |
6
- | fake | 0.2.0 |
7
- | fake | 1.0.0 |
8
- | ekaf | 1.0.0 |
9
- | ekaf | 1.0.1 |
10
-
11
- Scenario: Without a cookbook specified
12
- And I have a Berksfile pointing at the local Berkshelf API with:
13
- """
14
- cookbook 'ekaf', '~> 1.0.0'
15
- cookbook 'fake', '~> 0.1'
16
- """
17
- And I write to "Berksfile.lock" with:
18
- """
19
- DEPENDENCIES
20
- ekaf (~> 1.0.0)
21
- fake (~> 0.1)
22
-
23
- GRAPH
24
- ekaf (1.0.0)
25
- fake (0.1.0)
26
- """
27
- When I successfully run `berks update`
28
- Then the file "Berksfile.lock" should contain:
29
- """
30
- DEPENDENCIES
31
- ekaf (~> 1.0.0)
32
- fake (~> 0.1)
33
-
34
- GRAPH
35
- ekaf (1.0.1)
36
- fake (0.2.0)
37
- """
38
-
39
- Scenario: With a single cookbook specified
40
- And I have a Berksfile pointing at the local Berkshelf API with:
41
- """
42
- cookbook 'ekaf', '~> 1.0.0'
43
- cookbook 'fake', '~> 0.1'
44
- """
45
- And I write to "Berksfile.lock" with:
46
- """
47
- DEPENDENCIES
48
- ekaf (~> 1.0.0)
49
- fake (~> 0.1)
50
-
51
- GRAPH
52
- ekaf (1.0.0)
53
- fake (0.1.0)
54
- """
55
- When I successfully run `berks update fake`
56
- Then the file "Berksfile.lock" should contain:
57
- """
58
- DEPENDENCIES
59
- ekaf (~> 1.0.0)
60
- fake (~> 0.1)
61
-
62
- GRAPH
63
- ekaf (1.0.0)
64
- fake (0.2.0)
65
- """
66
-
67
- Scenario: With a transitive dependency specified
68
- Given the cookbook store contains a cookbook "seth" "1.0.0" with dependencies:
69
- | fake | ~> 0.1 |
70
- And I have a Berksfile pointing at the local Berkshelf API with:
71
- """
72
- cookbook 'seth', '1.0.0'
73
- """
74
- And I write to "Berksfile.lock" with:
75
- """
76
- DEPENDENCIES
77
- seth (= 1.0.0)
78
-
79
- GRAPH
80
- fake (0.1.0)
81
- seth (1.0.0)
82
- fake (~> 0.1)
83
- """
84
- When I successfully run `berks update fake`
85
- Then the file "Berksfile.lock" should contain:
86
- """
87
- DEPENDENCIES
88
- seth (= 1.0.0)
89
-
90
- GRAPH
91
- fake (0.2.0)
92
- seth (1.0.0)
93
- fake (~> 0.1)
94
- """
95
-
96
- Scenario: With a git location
97
- Given I have a Berksfile pointing at the local Berkshelf API with:
98
- """
99
- cookbook 'berkshelf-cookbook-fixture', git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture'
100
- """
101
- And I write to "Berksfile.lock" with:
102
- """
103
- DEPENDENCIES
104
- berkshelf-cookbook-fixture
105
- git: git://github.com/RiotGames/berkshelf-cookbook-fixture
106
- revision: 70a527e17d91f01f031204562460ad1c17f972ee
107
-
108
- GRAPH
109
- berkshelf-cookbook-fixture (0.2.0)
110
- """
111
- And I successfully run `berks install`
112
- When I successfully run `berks update`
113
- Then the file "Berksfile.lock" should contain:
114
- """
115
- DEPENDENCIES
116
- berkshelf-cookbook-fixture
117
- git: git://github.com/RiotGames/berkshelf-cookbook-fixture
118
- revision: a97b9447cbd41a5fe58eee2026e48ccb503bd3bc
119
-
120
- GRAPH
121
- berkshelf-cookbook-fixture (1.0.0)
122
- """
123
-
124
- Scenario: With a cookbook that does not exist
125
- Given I have a Berksfile pointing at the local Berkshelf API with:
126
- """
127
- cookbook 'fake'
128
- """
129
- And I write to "Berksfile.lock" with:
130
- """
131
- DEPENDENCIES
132
- fake
133
-
134
- GRAPH
135
- fake (0.2.0)
136
- """
137
- When I run `berks update not_real`
138
- Then the output should contain:
139
- """
140
- Dependency 'not_real' was not found. Please make sure it is in your Berksfile, and then run `berks install` to download and install the missing dependencies.
141
- """
142
- And the exit status should be "DependencyNotFound"
@@ -1,499 +0,0 @@
1
- Feature: berks upload
2
- Background:
3
- * the Chef Server is empty
4
- * the cookbook store has the cookbooks:
5
- | fake | 1.0.0 |
6
- | ekaf | 2.0.0 |
7
- | oops | 3.0.0 |
8
-
9
- Scenario: multiple cookbooks with no arguments
10
- And I have a Berksfile pointing at the local Berkshelf API with:
11
- """
12
- cookbook 'fake', '1.0.0'
13
- cookbook 'ekaf', '2.0.0'
14
- """
15
- And I write to "Berksfile.lock" with:
16
- """
17
- DEPENDENCIES
18
- fake (= 1.0.0)
19
- ekaf (= 2.0.0)
20
-
21
- GRAPH
22
- fake (1.0.0)
23
- ekaf (2.0.0)
24
- """
25
- When I successfully run `berks upload`
26
- Then the Chef Server should have the cookbooks:
27
- | fake | 1.0.0 |
28
- | ekaf | 2.0.0 |
29
-
30
- Scenario: a cookbook without metadata.json
31
- Given a cookbook named "fake"
32
- And I have a Berksfile pointing at the local Berkshelf API with:
33
- """
34
- metadata
35
- """
36
- And I write to "metadata.rb" with:
37
- """
38
- name 'bacon'
39
- version '1.0.0'
40
- """
41
- When I successfully run `berks install`
42
- And I successfully run `berks upload`
43
- Then the Chef Server should have the cookbooks:
44
- | bacon | 1.0.0 |
45
- And a file named "metadata.json" should not exist
46
-
47
- Scenario: a cookbook with metadata.json
48
- Given a cookbook named "fake"
49
- And I have a Berksfile pointing at the local Berkshelf API with:
50
- """
51
- metadata
52
- """
53
- And I write to "metadata.rb" with:
54
- """
55
- name 'bacon'
56
- version '1.0.0'
57
- """
58
- And I write to "metadata.json" with:
59
- """
60
- {
61
- "name": "bacon",
62
- "description": "",
63
- "long_description": "",
64
- "maintainer": "",
65
- "maintainer_email": "",
66
- "license": "All rights reserved",
67
- "platforms": {
68
-
69
- },
70
- "dependencies": {
71
-
72
- },
73
- "providing": {
74
-
75
- },
76
- "attributes": {
77
-
78
- },
79
- "recipes": {
80
-
81
- },
82
- "version": "1.0.0",
83
- "source_url": "",
84
- "issues_url": "",
85
- "privacy": false,
86
- "chef_versions": [
87
-
88
- ],
89
- "ohai_versions": [
90
-
91
- ],
92
- "gems": [
93
-
94
- ]
95
- }
96
- """
97
- When I successfully run `berks install`
98
- And I successfully run `berks upload`
99
- Then the Chef Server should have the cookbooks:
100
- | bacon | 1.0.0 |
101
- And a file named "metadata.json" should exist
102
-
103
- Scenario: a cookbook with a path location
104
- Given a cookbook named "fake"
105
- And I have a Berksfile pointing at the local Berkshelf API with:
106
- """
107
- cookbook 'fake', path: './fake'
108
- """
109
- And I write to "Berksfile.lock" with:
110
- """
111
- DEPENDENCIES
112
- fake
113
- path: ./fake
114
-
115
- GRAPH
116
- fake (0.0.0)
117
- """
118
- When I successfully run `berks upload`
119
- Then the Chef Server should have the cookbooks:
120
- | fake | 0.0.0 |
121
-
122
- Scenario: specifying a single cookbook with dependencies
123
- Given the cookbook store contains a cookbook "reset" "3.4.5" with dependencies:
124
- | fake | = 1.0.0 |
125
- And I have a Berksfile pointing at the local Berkshelf API with:
126
- """
127
- cookbook 'fake', '1.0.0'
128
- cookbook 'ekaf', '2.0.0'
129
- cookbook 'reset', '3.4.5'
130
- """
131
- And I write to "Berksfile.lock" with:
132
- """
133
- DEPENDENCIES
134
- ekaf (= 2.0.0)
135
- fake (= 1.0.0)
136
- reset (= 3.4.5)
137
-
138
- GRAPH
139
- ekaf (2.0.0)
140
- fake (1.0.0)
141
- reset (3.4.5)
142
- fake (= 1.0.0)
143
- """
144
- When I successfully run `berks upload reset`
145
- Then the Chef Server should have the cookbooks:
146
- | reset | 3.4.5 |
147
- And the Chef Server should not have the cookbooks:
148
- | fake | 1.0.0 |
149
- | ekaf | 2.0.0 |
150
-
151
- Scenario: specifying a single cookbook that is a transitive dependency
152
- Given the cookbook store contains a cookbook "reset" "3.4.5" with dependencies:
153
- | fake | 1.0.0 |
154
- | ekaf | 2.0.0 |
155
- And I have a Berksfile pointing at the local Berkshelf API with:
156
- """
157
- cookbook 'reset', '3.4.5'
158
- """
159
- And I write to "Berksfile.lock" with:
160
- """
161
- DEPENDENCIES
162
- reset (= 3.4.5)
163
-
164
- GRAPH
165
- ekaf (2.0.0)
166
- fake (1.0.0)
167
- reset (3.4.5)
168
- ekaf (= 2.0.0)
169
- fake (= 1.0.0)
170
- """
171
- When I successfully run `berks upload fake`
172
- Then the Chef Server should have the cookbooks:
173
- | fake | 1.0.0 |
174
-
175
- Scenario: specifying a dependency not defined in the Berksfile
176
- Given I have a Berksfile pointing at the local Berkshelf API
177
- And I write to "Berksfile.lock" with:
178
- """
179
- DEPENDENCIES
180
- fake (= 1.0.0)
181
-
182
- GRAPH
183
- fake (1.0.0)
184
- """
185
- When I run `berks upload reset`
186
- Then the output should contain:
187
- """
188
- Dependency 'reset' was not found. Please make sure it is in your Berksfile, and then run `berks install` to download and install the missing dependencies.
189
- """
190
- And the exit status should be "DependencyNotFound"
191
-
192
- Scenario: specifying multiple cookbooks to upload
193
- Given I have a Berksfile pointing at the local Berkshelf API with:
194
- """
195
- cookbook 'fake', '1.0.0'
196
- cookbook 'ekaf', '2.0.0'
197
- cookbook 'oops', '3.0.0'
198
- """
199
- And I write to "Berksfile.lock" with:
200
- """
201
- DEPENDENCIES
202
- ekaf (= 2.0.0)
203
- fake (= 1.0.0)
204
- oops (= 3.0.0)
205
-
206
- GRAPH
207
- ekaf (2.0.0)
208
- fake (1.0.0)
209
- oops (3.0.0)
210
- """
211
- When I successfully run `berks upload fake ekaf`
212
- Then the Chef Server should have the cookbooks:
213
- | fake |
214
- | ekaf |
215
- And the Chef Server should not have the cookbooks:
216
- | oops |
217
-
218
- Scenario: uploading a filter does not change the lockfile
219
- Given I have a Berksfile pointing at the local Berkshelf API with:
220
- """
221
- cookbook 'fake', group: :take_me
222
- cookbook 'ekaf', group: :not_me
223
- """
224
- And I write to "Berksfile.lock" with:
225
- """
226
- DEPENDENCIES
227
- ekaf
228
- fake
229
-
230
- GRAPH
231
- ekaf (2.0.0)
232
- fake (1.0.0)
233
- """
234
- When I run `berks upload --only take_me`
235
- Then the file "Berksfile.lock" should contain:
236
- """
237
- DEPENDENCIES
238
- ekaf
239
- fake
240
-
241
- GRAPH
242
- ekaf (2.0.0)
243
- fake (1.0.0)
244
- """
245
-
246
- Scenario: uploading a single groups of demands with the --only flag
247
- Given I have a Berksfile pointing at the local Berkshelf API with:
248
- """
249
- cookbook 'fake', group: :take_me
250
- cookbook 'ekaf', group: :not_me
251
- """
252
- And I write to "Berksfile.lock" with:
253
- """
254
- DEPENDENCIES
255
- ekaf
256
- fake
257
-
258
- GRAPH
259
- ekaf (2.0.0)
260
- fake (1.0.0)
261
- """
262
- When I successfully run `berks upload --only take_me`
263
- Then the Chef Server should have the cookbooks:
264
- | fake | 1.0.0 |
265
- And the Chef Server should not have the cookbooks:
266
- | ekaf | 2.0.0 |
267
-
268
- Scenario: uploading multiple groups of demands with the --only flag
269
- Given I have a Berksfile pointing at the local Berkshelf API with:
270
- """
271
- cookbook 'fake', group: :take_me
272
- cookbook 'ekaf', group: :not_me
273
- """
274
- And I write to "Berksfile.lock" with:
275
- """
276
- DEPENDENCIES
277
- ekaf
278
- fake
279
-
280
- GRAPH
281
- ekaf (2.0.0)
282
- fake (1.0.0)
283
- """
284
- When I successfully run `berks upload --only take_me not_me`
285
- And the Chef Server should have the cookbooks:
286
- | fake | 1.0.0 |
287
- | ekaf | 2.0.0 |
288
-
289
- Scenario: skipping a single group to upload with the --except flag
290
- Given I have a Berksfile pointing at the local Berkshelf API with:
291
- """
292
- cookbook 'fake', group: :take_me
293
- cookbook 'ekaf', group: :not_me
294
- """
295
- And I write to "Berksfile.lock" with:
296
- """
297
- DEPENDENCIES
298
- ekaf
299
- fake
300
-
301
- GRAPH
302
- ekaf (2.0.0)
303
- fake (1.0.0)
304
- """
305
- When I successfully run `berks upload --except not_me`
306
- And the Chef Server should have the cookbooks:
307
- | fake | 1.0.0 |
308
- And the Chef Server should not have the cookbooks:
309
- | ekaf | 2.0.0 |
310
-
311
- Scenario: skipping multiple groups with the --except flag
312
- Given I have a Berksfile pointing at the local Berkshelf API with:
313
- """
314
- cookbook 'fake', group: :take_me
315
- cookbook 'ekaf', group: :not_me
316
- """
317
- And I write to "Berksfile.lock" with:
318
- """
319
- DEPENDENCIES
320
- ekaf
321
- fake
322
-
323
- GRAPH
324
- ekaf (2.0.0)
325
- fake (1.0.0)
326
- """
327
- When I successfully run `berks upload --except take_me not_me`
328
- And the Chef Server should not have the cookbooks:
329
- | fake | 1.0.0 |
330
- | ekaf | 2.0.0 |
331
-
332
- Scenario: specifying cookbooks with transitive dependencies in a group
333
- Given the cookbook store contains a cookbook "reset" "3.4.5" with dependencies:
334
- | fake | 1.0.0 |
335
- And the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
336
- | ekaf | 2.0.0 |
337
- And I have a Berksfile pointing at the local Berkshelf API with:
338
- """
339
- group :rockstars do
340
- cookbook 'reset', '3.4.5'
341
- end
342
-
343
- group :losers do
344
- cookbook 'seth', '1.0.0'
345
- end
346
- """
347
- And I write to "Berksfile.lock" with:
348
- """
349
- DEPENDENCIES
350
- reset (= 3.4.5)
351
-
352
- GRAPH
353
- ekaf (2.0.0)
354
- fake (1.0.0)
355
- ekaf (= 2.0.0)
356
- reset (3.4.5)
357
- fake (= 1.0.0)
358
- """
359
- When I successfully run `berks upload --only rockstars`
360
- Then the Chef Server should have the cookbooks:
361
- | reset | 3.4.5 |
362
- | fake | 1.0.0 |
363
- | ekaf | 2.0.0 |
364
- And the Chef Server should not have the cookbooks:
365
- | seth | 1.0.0 |
366
-
367
- Scenario: attempting to upload an invalid cookbook
368
- Given a cookbook named "cookbook with spaces"
369
- And I have a Berksfile pointing at the local Berkshelf API with:
370
- """
371
- cookbook 'cookbook with spaces', path: './cookbook with spaces'
372
- """
373
- And I write to "Berksfile.lock" with:
374
- """
375
- DEPENDENCIES
376
- cookbook with spaces
377
- path: ./cookbook with spaces
378
-
379
- GRAPH
380
- cookbook with spaces (0.0.0)
381
- """
382
- When I run `berks upload`
383
- Then the output should contain:
384
- """
385
- The cookbook 'cookbook with spaces' has invalid filenames:
386
- """
387
- And the exit status should be "InvalidCookbookFiles"
388
-
389
- Scenario: With unicode characters
390
- Given a cookbook named "fake"
391
- And I cd to "fake"
392
- And I write to "README.md" with:
393
- """
394
- Jamié Wiñsor
395
- 赛斯瓦戈
396
- Μιψηαελ Ιωευ
397
- جوستين كامبل
398
- """
399
- And I have a Berksfile pointing at the local Berkshelf API with:
400
- """
401
- metadata
402
- """
403
- And I write to "Berksfile.lock" with:
404
- """
405
- DEPENDENCIES
406
- fake
407
- path: .
408
- metadata: true
409
-
410
- GRAPH
411
- fake (0.0.0)
412
- """
413
- When I successfully run `berks upload fake`
414
- Then the output should contain:
415
- """
416
- Uploaded fake (0.0.0)
417
- """
418
-
419
- Scenario: When the cookbook already exist
420
- And the Chef Server has frozen cookbooks:
421
- | fake | 1.0.0 |
422
- Given I have a Berksfile pointing at the local Berkshelf API with:
423
- """
424
- cookbook 'fake', '1.0.0'
425
- """
426
- And I write to "Berksfile.lock" with:
427
- """
428
- DEPENDENCIES
429
- fake (= 1.0.0)
430
-
431
- GRAPH
432
- fake (1.0.0)
433
- """
434
- When I successfully run `berks upload`
435
- Then the output should contain:
436
- """
437
- Skipping fake (1.0.0) (frozen)
438
- """
439
-
440
- Scenario: When the cookbook already exist and is a metadata location
441
- Given a cookbook named "fake"
442
- And the cookbook "fake" has the file "Berksfile" with:
443
- """
444
- metadata
445
- """
446
- And I cd to "fake"
447
- And I write to "Berksfile.lock" with:
448
- """
449
- DEPENDENCIES
450
- fake
451
- path: .
452
- metadata: true
453
-
454
- GRAPH
455
- fake (0.0.0)
456
- """
457
- And the Chef Server has frozen cookbooks:
458
- | fake | 0.0.0 |
459
- When I successfully run `berks upload`
460
- Then the output should contain:
461
- """
462
- Skipping fake (0.0.0) (frozen)
463
- """
464
-
465
- Scenario: When the syntax check is skipped
466
- Given a cookbook named "fake"
467
- And the cookbook "fake" has the file "recipes/default.rb" with:
468
- """
469
- Totally not valid Ruby syntax
470
- """
471
- And the cookbook "fake" has the file "templates/default/file.erb" with:
472
- """
473
- <% for %>
474
- """
475
- And the cookbook "fake" has the file "recipes/template.rb" with:
476
- """
477
- template "/tmp/wadus" do
478
- source "file.erb"
479
- end
480
- """
481
- And the cookbook "fake" has the file "Berksfile" with:
482
- """
483
- source 'https://supermarket.chef.io'
484
- metadata
485
- """
486
- And the cookbook "fake" has the file "Berksfile.lock" with:
487
- """
488
- DEPENDENCIES
489
- fake
490
- path: .
491
- metadata: true
492
-
493
- GRAPH
494
- fake (0.0.0)
495
- """
496
- And I cd to "fake"
497
- When I successfully run `berks upload --skip-syntax-check`
498
- Then the Chef Server should have the cookbooks:
499
- | fake | 0.0.0 |