berkshelf 3.0.0.beta9 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a93a58092d85d92072229df17a0ac18f86be4c61
4
- data.tar.gz: 2d5f1a561cc471759fff50cdd1e1838ac3ad6728
3
+ metadata.gz: 90ffa4862aad42150a8e4a7386f48a3495f0f7ef
4
+ data.tar.gz: 215b5e4128bc085893ee1740e8d02d73a6fdbd90
5
5
  SHA512:
6
- metadata.gz: f2a9db9d98a43f866c73d75cb3a74418f96dd4feadfb4d20d57ef47e8f0dd0a50d787a5446e0c66050383918c4acd9781e948c6e5c84c1a5d5cfd79e1219301d
7
- data.tar.gz: 78395f776b664f4184f6d9fd91ca564833db46d684571a93734c34516c4d894774ba1320774ad3054757177e9ddc861b7ceba96b244f281c25c8f689bd8b13a4
6
+ metadata.gz: 5725f1b7ca2b51b17cbfdad97727f06548ae6445b90646f2c85293fcec6f5f160eaf36c0a7ccef26efc6333902e6d3885190a6a1b4033d0c8e87fd7ae8eb4d14
7
+ data.tar.gz: 814b494a2a9f5c92df52effecc0208938ff6829a22d5c21ee1f6a00526826df3c978f87cf2b9ff2dab9905ae854d438be00b20263c67cd1b011a2b24b31286c0
data/.travis.yml CHANGED
@@ -9,9 +9,13 @@ notifications:
9
9
  - "irc.freenode.org#berkshelf"
10
10
  skip_join: true
11
11
  use_notice: true
12
+ webhooks:
13
+ urls:
14
+ - "https://webhooks.gitter.im/e/cdd41ff6c4d1f062c2f1"
12
15
  branches:
13
16
  only:
14
17
  - master
18
+ env: USE_SYSTEM_GECODE=1
15
19
  bundler_args: --without guard --jobs 7
16
20
  before_install:
17
21
  - sudo apt-get install -qq libarchive12 libarchive-dev libgecode-dev
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
- Berkshelf
2
- =========
1
+ # Berkshelf
3
2
  [![Gem Version](https://img.shields.io/gem/v/berkshelf.svg)][gem]
4
3
  [![Build Status](https://img.shields.io/travis/berkshelf/berkshelf.svg)][travis]
5
4
 
@@ -8,11 +7,40 @@ Berkshelf
8
7
 
9
8
  Manage a Cookbook or an Application's Cookbook dependencies
10
9
 
11
- Installation
12
- ------------
10
+ ## Installation
13
11
 
14
12
  **WARNING:** It is advised at this time that you [use Berkshelf 3](https://github.com/berkshelf/berkshelf/wiki/Howto:-Use-the-bleeding-edge). Berkshelf 2 is no longer being actively developed and has a number of significant issues related to dependency resolution that Berkshelf 3 fixes.
15
13
 
14
+ ### Manually install Gecode (temporary)
15
+
16
+ The current release candidate of Vagrant Berkshelf requires you to have Gecode installed on your machine. In the future this process will be provided in an easy and automated fashion.
17
+
18
+ #### OSX
19
+
20
+ $ cd $( brew --prefix )
21
+ $ git checkout 3c5ca25 Library/Formula/gecode.rb
22
+ $ brew install gecode
23
+
24
+ #### Debian and Ubuntu
25
+
26
+ $ sudo apt-get install libgecode-dev
27
+
28
+ ##### Source
29
+
30
+ $ curl -O http://www.gecode.org/download/gecode-3.7.3.tar.gz
31
+ $ tar zxvf gecode-3.7.3.tar.gz
32
+ $ ./configure --disable-doc-dot \
33
+ --disable-doc-search \
34
+ --disable-doc-tagfile \
35
+ --disable-doc-chm \
36
+ --disable-doc-docset \
37
+ --disable-qt \
38
+ --disable-examples
39
+ $ make
40
+ $ (sudo) make install
41
+
42
+ ### Gem Installation
43
+
16
44
  Add Berkshelf to your repository's `Gemfile`:
17
45
 
18
46
  ```ruby
@@ -21,90 +49,83 @@ gem 'berkshelf'
21
49
 
22
50
  Or run it as a standalone:
23
51
 
24
- gem install berkshelf
52
+ $ gem install berkshelf
53
+
54
+ ## Usage
25
55
 
26
- Usage
27
- -----
28
56
  See [berkshelf.com](http://berkshelf.com) for up-to-date usage instructions.
29
57
 
30
- Supported Platforms
31
- -------------------
58
+ ## Supported Platforms
59
+
32
60
  Berkshelf is tested on Ruby 1.9.3, 2.0.0, and JRuby 1.6+.
33
61
 
34
62
  Ruby 1.9 mode is required on all interpreters.
35
63
 
36
64
  Ruby 1.9.1 and 1.9.2 are not officially supported. If you encounter problems, please upgrade to Ruby 2.0 or 1.9.3.
37
65
 
38
- Shell Completion
39
- ----------------
66
+ ## Shell Completion
67
+
40
68
  - [Bash](https://github.com/berkshelf/berkshelf-bash-plugin)
41
69
  - [ZSH](https://github.com/berkshelf/berkshelf-zsh-plugin)
42
70
 
43
- Plugins
44
- -------
71
+ ## Plugins
72
+
45
73
  Please see [Plugins page](https://github.com/berkshelf/berkshelf/blob/master/PLUGINS.md) for more information.
46
74
 
47
- Configuration
48
- -------------
75
+ ## Configuration
76
+
49
77
  Berkshelf will search in specific locations for a configuration file. In order:
50
78
 
51
- ```text
52
- $PWD/.berkshelf/config.json
53
- $PWD/berkshelf/config.json
54
- $PWD/berkshelf-config.json
55
- $PWD/config.json
56
- ~/.berkshelf/config.json
57
- ```
79
+ $PWD/.berkshelf/config.json
80
+ $PWD/berkshelf/config.json
81
+ $PWD/berkshelf-config.json
82
+ $PWD/config.json
83
+ ~/.berkshelf/config.json
58
84
 
59
85
  You are encouraged to keep project-specific configuration in the `$PWD/.berkshelf` directory. A default configuration file is generated for you, but you can update the values to suit your needs.
60
86
 
61
- Github Cookbooks
62
- ----------------
87
+ ## Github Cookbooks
88
+
63
89
  With Berkshelf 3 you can query a Berkshelf-API server (a server which indexes cookbooks from various sources and
64
90
  hosts it over a REST API) in order to resolve the cookbook dependencies. When you choose to host your own Berkshelf-API
65
91
  server, you can configure it to also index cookbooks hosted in various Github and/or Github Enterprise organizations.
66
92
 
67
93
  When doing so you should also configure Berkshelf so it can download cookbooks from your indexed Github organizations:
68
94
 
69
- ```
70
- {
71
- "github":[
72
- {
73
- "access_token": ""
74
- },
75
95
  {
76
- "access_token": "",
77
- "api_endpoint": "https://github.enterprise.local/api/v3",
78
- "web_endpoint": "https://github.enterprise.local",
79
- "ssl_verify": true
96
+ "github":[
97
+ {
98
+ "access_token": ""
99
+ },
100
+ {
101
+ "access_token": "",
102
+ "api_endpoint": "https://github.enterprise.local/api/v3",
103
+ "web_endpoint": "https://github.enterprise.local",
104
+ "ssl_verify": true
105
+ }
106
+ ]
80
107
  }
81
- ]
82
- }
83
- ```
84
108
 
85
109
  The first subsection is used for any organization hosted on github.com. As this is the default, you do not have to set the
86
110
  endpoint info (these are known values for github.com). The second subsection is used when you also index cookbooks from
87
111
  organizations hosted on Github Enterprise. In this case you will need to specify the specific endpoint info so Berkshelf
88
112
  knows where to connect to. You can add as many subsections as you have endpoints.
89
113
 
90
- SSL Errors
91
- ----------
114
+ ## SSL Errors
92
115
 
93
116
  If you have trouble getting Berkshelf to successfully talk to an SSL Chef Server, you can try making sure you
94
117
  have a certificate bundle available to your shell. `export SSL_CERT_FILE=...path/to/cert/file...`
95
118
 
96
119
  If you need to disable SSL, you can in `~/.berkshelf/config.json` like so:
97
120
 
98
- ```
99
- {
100
- "ssl": {
101
- "verify": false
102
- }
103
- }
104
- ```
121
+ {
122
+ "ssl": {
123
+ "verify": false
124
+ }
125
+ }
126
+
127
+ ## Authors
105
128
 
106
- Authors
107
- -------
108
129
  - Jamie Winsor (<jamie@vialstudios.com>)
109
130
  - Josiah Kiehl (<jkiehl@riotgames.com>)
110
131
  - Michael Ivey (<michael.ivey@riotgames.com>)
data/berkshelf.gemspec CHANGED
@@ -39,8 +39,8 @@ Gem::Specification.new do |s|
39
39
  s.add_dependency 'minitar', '~> 0.5.4'
40
40
  s.add_dependency 'retryable', '~> 1.3.3'
41
41
  s.add_dependency 'ridley', '~> 3.0'
42
- s.add_dependency 'solve', '~> 1.0.0.rc1'
43
- s.add_dependency 'thor', '~> 0.18.0'
42
+ s.add_dependency 'solve', '~> 1.0.0.rc3'
43
+ s.add_dependency 'thor', '~> 0.18'
44
44
  s.add_dependency 'octokit', '~> 2.6'
45
45
 
46
46
  s.add_development_dependency 'aruba', '~> 0.5'
@@ -49,7 +49,7 @@ Gem::Specification.new do |s|
49
49
  s.add_development_dependency 'rake', '~> 0.9'
50
50
  s.add_development_dependency 'rspec', '~> 2.13'
51
51
  s.add_development_dependency 'spork', '~> 0.9'
52
- s.add_development_dependency 'test-kitchen', '>= 1.0.0.alpha7'
52
+ s.add_development_dependency 'test-kitchen', '~> 1.2'
53
53
  s.add_development_dependency 'webmock', '~> 1.11'
54
54
  s.add_development_dependency 'yard', '~> 0.8'
55
55
  end
@@ -64,6 +64,35 @@ Feature: berks update
64
64
  fake (0.2.0)
65
65
  """
66
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
+
67
96
  Scenario: With a git location
68
97
  Given I have a Berksfile pointing at the local Berkshelf API with:
69
98
  """
@@ -93,7 +122,18 @@ Feature: berks update
93
122
  """
94
123
 
95
124
  Scenario: With a cookbook that does not exist
96
- Given I have a Berksfile pointing at the local Berkshelf API
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
+ """
97
137
  When I run `berks update not_real`
98
138
  Then the output should contain:
99
139
  """
@@ -71,10 +71,34 @@ Feature: berks upload
71
71
  When I successfully run `berks upload reset`
72
72
  Then the Chef Server should have the cookbooks:
73
73
  | reset | 3.4.5 |
74
- | fake | 1.0.0 |
75
74
  And the Chef Server should not have the cookbooks:
75
+ | fake | 1.0.0 |
76
76
  | ekaf | 2.0.0 |
77
77
 
78
+ Scenario: specifying a single cookbook that is a transitive dependency
79
+ Given the cookbook store contains a cookbook "reset" "3.4.5" with dependencies:
80
+ | fake | 1.0.0 |
81
+ | ekaf | 2.0.0 |
82
+ And I have a Berksfile pointing at the local Berkshelf API with:
83
+ """
84
+ cookbook 'reset', '3.4.5'
85
+ """
86
+ And I write to "Berksfile.lock" with:
87
+ """
88
+ DEPENDENCIES
89
+ reset (= 3.4.5)
90
+
91
+ GRAPH
92
+ ekaf (2.0.0)
93
+ fake (1.0.0)
94
+ reset (3.4.5)
95
+ ekaf (= 2.0.0)
96
+ fake (= 1.0.0)
97
+ """
98
+ When I successfully run `berks upload fake`
99
+ Then the Chef Server should have the cookbooks:
100
+ | fake | 1.0.0 |
101
+
78
102
  Scenario: specifying a dependency not defined in the Berksfile
79
103
  Given I have a Berksfile pointing at the local Berkshelf API
80
104
  And I write to "Berksfile.lock" with:
@@ -232,6 +256,41 @@ Feature: berks upload
232
256
  | fake | 1.0.0 |
233
257
  | ekaf | 2.0.0 |
234
258
 
259
+ Scenario: specifying cookbooks with transitive dependencies in a group
260
+ Given the cookbook store contains a cookbook "reset" "3.4.5" with dependencies:
261
+ | fake | 1.0.0 |
262
+ And the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
263
+ | ekaf | 2.0.0 |
264
+ And I have a Berksfile pointing at the local Berkshelf API with:
265
+ """
266
+ group :rockstars do
267
+ cookbook 'reset', '3.4.5'
268
+ end
269
+
270
+ group :losers do
271
+ cookbook 'seth', '1.0.0'
272
+ end
273
+ """
274
+ And I write to "Berksfile.lock" with:
275
+ """
276
+ DEPENDENCIES
277
+ reset (= 3.4.5)
278
+
279
+ GRAPH
280
+ ekaf (2.0.0)
281
+ fake (1.0.0)
282
+ ekaf (= 2.0.0)
283
+ reset (3.4.5)
284
+ fake (= 1.0.0)
285
+ """
286
+ When I successfully run `berks upload --only rockstars`
287
+ Then the Chef Server should have the cookbooks:
288
+ | reset | 3.4.5 |
289
+ | fake | 1.0.0 |
290
+ | ekaf | 2.0.0 |
291
+ And the Chef Server should not have the cookbooks:
292
+ | seth | 1.0.0 |
293
+
235
294
  Scenario: attempting to upload an invalid cookbook
236
295
  Given a cookbook named "cookbook with spaces"
237
296
  And I have a Berksfile pointing at the local Berkshelf API with:
@@ -281,7 +340,7 @@ Feature: berks upload
281
340
  When I successfully run `berks upload fake`
282
341
  Then the output should contain:
283
342
  """
284
- Uploading fake (0.0.0)
343
+ Uploaded fake (0.0.0)
285
344
  """
286
345
 
287
346
  Scenario: When the cookbook already exist
@@ -304,12 +363,6 @@ Feature: berks upload
304
363
  """
305
364
  Skipping fake (1.0.0) (frozen)
306
365
  """
307
- And the output should contain:
308
- """
309
- Skipped uploading some cookbooks because they already exist on the remote server and are frozen. Re-run with the `--force` flag to force overwrite these cookbooks:
310
-
311
- * fake (1.0.0)
312
- """
313
366
 
314
367
  Scenario: When the cookbook already exist and is a metadata location
315
368
  Given a cookbook named "fake"
@@ -334,9 +387,6 @@ Feature: berks upload
334
387
  Then the output should contain:
335
388
  """
336
389
  Skipping fake (0.0.0) (frozen)
337
- Skipped uploading some cookbooks because they already exist on the remote server and are frozen. Re-run with the `--force` flag to force overwrite these cookbooks:
338
-
339
- * fake (0.0.0)
340
390
  """
341
391
 
342
392
  Scenario: When the syntax check is skipped
@@ -209,6 +209,99 @@ Feature: Lifecycle commands
209
209
  * the output should not contain "Using ekaf (1.0.0)"
210
210
  * the output should contain "Using fake (1.0.0)"
211
211
 
212
+ Scenario: Moving a transitive dependency to a direct dependency
213
+ * I have a Berksfile pointing at the local Berkshelf API with:
214
+ """
215
+ metadata
216
+ """
217
+ * I write to "metadata.rb" with:
218
+ """
219
+ name 'transitive'
220
+ version '1.2.3'
221
+ depends 'fake', '1.0.0'
222
+ """
223
+ * I successfully run `berks install`
224
+ * the file "Berksfile.lock" should contain:
225
+ """
226
+ DEPENDENCIES
227
+ transitive
228
+ path: .
229
+ metadata: true
230
+
231
+ GRAPH
232
+ fake (1.0.0)
233
+ transitive (1.2.3)
234
+ fake (= 1.0.0)
235
+ """
236
+ * the output should not contain "Using ekaf (1.0.0)"
237
+ * the output should contain "Using fake (1.0.0)"
238
+ * I write to "fake/metadata.rb" with:
239
+ """
240
+ name 'fake'
241
+ version '1.0.0'
242
+ """
243
+ * I have a Berksfile pointing at the local Berkshelf API with:
244
+ """
245
+ metadata
246
+ cookbook 'fake', path: 'fake'
247
+ """
248
+ * I successfully run `berks install`
249
+ * the file "Berksfile.lock" should contain:
250
+ """
251
+ DEPENDENCIES
252
+ fake
253
+ path: ./fake
254
+ transitive
255
+ path: .
256
+ metadata: true
257
+
258
+ GRAPH
259
+ fake (1.0.0)
260
+ transitive (1.2.3)
261
+ fake (= 1.0.0)
262
+ """
263
+
264
+ Scenario: Moving a transitive dependency to a direct dependency and then removing it
265
+ * I have a Berksfile pointing at the local Berkshelf API with:
266
+ """
267
+ metadata
268
+ """
269
+ * I write to "metadata.rb" with:
270
+ """
271
+ name 'transitive'
272
+ version '1.2.3'
273
+ depends 'fake'
274
+ """
275
+ * I successfully run `berks install`
276
+ * I write to "fake/metadata.rb" with:
277
+ """
278
+ name 'fake'
279
+ version '1.0.0'
280
+ """
281
+ * I have a Berksfile pointing at the local Berkshelf API with:
282
+ """
283
+ metadata
284
+ cookbook 'fake', path: 'fake'
285
+ """
286
+ * I successfully run `berks install`
287
+ * I have a Berksfile pointing at the local Berkshelf API with:
288
+ """
289
+ metadata
290
+ """
291
+ * I successfully run `berks install`
292
+ * the file "Berksfile.lock" should contain:
293
+ """
294
+ DEPENDENCIES
295
+ transitive
296
+ path: .
297
+ metadata: true
298
+
299
+ GRAPH
300
+ fake (1.0.0)
301
+ transitive (1.2.3)
302
+ fake (>= 0.0.0)
303
+ """
304
+
212
305
  Scenario: Bumping the version of a local cookbook
213
306
  * I have a Berksfile pointing at the local Berkshelf API with:
214
307
  """