berkshelf 5.0.0 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -2
- data/Gemfile.lock +36 -42
- data/Rakefile +29 -0
- data/appveyor.yml +31 -0
- data/berkshelf.gemspec +1 -1
- data/features/commands/install.feature +8 -8
- data/features/commands/search.feature +2 -1
- data/features/commands/shelf/uninstall.feature +3 -1
- data/features/commands/vendor.feature +4 -4
- data/features/commands/viz.feature +1 -1
- data/features/json_formatter.feature +4 -4
- data/features/step_definitions/berksfile_steps.rb +1 -1
- data/features/step_definitions/cli_steps.rb +14 -0
- data/lib/berkshelf/berksfile.rb +3 -2
- data/lib/berkshelf/cli.rb +5 -1
- data/lib/berkshelf/config.rb +3 -0
- data/lib/berkshelf/core_ext/file_utils.rb +12 -3
- data/lib/berkshelf/file_syncer.rb +22 -15
- data/lib/berkshelf/source.rb +11 -1
- data/lib/berkshelf/version.rb +1 -1
- data/spec/unit/berkshelf/berksfile_spec.rb +4 -4
- data/spec/unit/berkshelf/config_spec.rb +6 -0
- data/spec/unit/berkshelf/core_ext/file_utils_spec.rb +9 -4
- data/spec/unit/berkshelf/file_syncer_spec.rb +24 -2
- data/spec/unit/berkshelf/visualizer_spec.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bc1d114a16270012c8e6554bdeeef10c8daeb60
|
4
|
+
data.tar.gz: 097633f8a8909d0e1d2a3c5d68c17576723aa62f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d600075727841156d0ef1fb24c5f0577b7f657acd299d7743901b499db08a83ff482f9c937b3d026609fa53a67d619c1a826a2705676ce3cd3697739404bb69
|
7
|
+
data.tar.gz: f845e6cd2bb95e7e90dd3b267d4c9d06f7692c09d299b4b2068b945c1c68fdc2f0caba8bc740c4378e1999ccf7280456f0335a805940ab659ecc6965607c3604
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,27 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [5.
|
4
|
-
[Full Changelog](https://github.com/berkshelf/berkshelf/compare/
|
3
|
+
## [5.1.0](https://github.com/berkshelf/berkshelf/tree/5.1.0) (2016-09-16)
|
4
|
+
[Full Changelog](https://github.com/berkshelf/berkshelf/compare/v5.0.0...5.1.0)
|
5
5
|
|
6
6
|
**Merged pull requests:**
|
7
7
|
|
8
|
+
- Disable caching of bundler since it's broken [\#1612](https://github.com/berkshelf/berkshelf/pull/1612) ([thommay](https://github.com/thommay))
|
9
|
+
- Update cli.rb [\#1611](https://github.com/berkshelf/berkshelf/pull/1611) ([martinmosegaard](https://github.com/martinmosegaard))
|
10
|
+
- fix cucumber tests [\#1609](https://github.com/berkshelf/berkshelf/pull/1609) ([mwrock](https://github.com/mwrock))
|
11
|
+
- Enable appveyor [\#1606](https://github.com/berkshelf/berkshelf/pull/1606) ([thommay](https://github.com/thommay))
|
12
|
+
- fix syncing windows user directories on ruby 2.3 [\#1605](https://github.com/berkshelf/berkshelf/pull/1605) ([mwrock](https://github.com/mwrock))
|
13
|
+
- Update buff-shell\_out to 1.0 [\#1604](https://github.com/berkshelf/berkshelf/pull/1604) ([jkeiser](https://github.com/jkeiser))
|
14
|
+
- Only fall back to cp/rm if we have to [\#1602](https://github.com/berkshelf/berkshelf/pull/1602) ([thommay](https://github.com/thommay))
|
15
|
+
- Expose configuration for API timeouts [\#1601](https://github.com/berkshelf/berkshelf/pull/1601) ([thommay](https://github.com/thommay))
|
16
|
+
- Only optionally remove the contents of the target [\#1599](https://github.com/berkshelf/berkshelf/pull/1599) ([thommay](https://github.com/thommay))
|
17
|
+
|
18
|
+
## [v5.0.0](https://github.com/berkshelf/berkshelf/tree/v5.0.0) (2016-08-30)
|
19
|
+
[Full Changelog](https://github.com/berkshelf/berkshelf/compare/v4.3.5...v5.0.0)
|
20
|
+
|
21
|
+
**Merged pull requests:**
|
22
|
+
|
23
|
+
- Atomically move git located cookbook to cache [\#1598](https://github.com/berkshelf/berkshelf/pull/1598) ([kamaradclimber](https://github.com/kamaradclimber))
|
24
|
+
- Faild `berks install` with ENV\['BERKSHELF\_PATH'\] [\#1595](https://github.com/berkshelf/berkshelf/pull/1595) ([hirocaster](https://github.com/hirocaster))
|
8
25
|
- Add Ruby 2.3 and Ruby 2.4 support - drop Ruby 2.1 support and older [\#1591](https://github.com/berkshelf/berkshelf/pull/1591) ([lamont-granquist](https://github.com/lamont-granquist))
|
9
26
|
- bump berkshelf-api and associated deps [\#1589](https://github.com/berkshelf/berkshelf/pull/1589) ([lamont-granquist](https://github.com/lamont-granquist))
|
10
27
|
- force encoding to UTF-8 [\#1588](https://github.com/berkshelf/berkshelf/pull/1588) ([lamont-granquist](https://github.com/lamont-granquist))
|
data/Gemfile.lock
CHANGED
@@ -19,12 +19,12 @@ GIT
|
|
19
19
|
PATH
|
20
20
|
remote: .
|
21
21
|
specs:
|
22
|
-
berkshelf (5.
|
22
|
+
berkshelf (5.1.0)
|
23
23
|
addressable (~> 2.3, >= 2.3.4)
|
24
24
|
berkshelf-api-client (>= 2.0.2, < 4.0)
|
25
25
|
buff-config (~> 2.0)
|
26
26
|
buff-extensions (~> 2.0)
|
27
|
-
buff-shell_out (~> 0
|
27
|
+
buff-shell_out (~> 1.0)
|
28
28
|
cleanroom (~> 1.0)
|
29
29
|
faraday (~> 0.9)
|
30
30
|
httpclient (~> 2.7)
|
@@ -39,7 +39,7 @@ PATH
|
|
39
39
|
GEM
|
40
40
|
remote: https://rubygems.org/
|
41
41
|
specs:
|
42
|
-
activesupport (4.2.7)
|
42
|
+
activesupport (4.2.7.1)
|
43
43
|
i18n (~> 0.7)
|
44
44
|
json (~> 1.7, >= 1.7.7)
|
45
45
|
minitest (~> 5.1)
|
@@ -48,8 +48,8 @@ GEM
|
|
48
48
|
addressable (2.4.0)
|
49
49
|
archive (0.0.6)
|
50
50
|
ffi (~> 1.9.3)
|
51
|
-
artifactory (2.
|
52
|
-
aruba (0.14.
|
51
|
+
artifactory (2.4.0)
|
52
|
+
aruba (0.14.2)
|
53
53
|
childprocess (~> 0.5.6)
|
54
54
|
contracts (~> 0.9)
|
55
55
|
cucumber (>= 1.3.19)
|
@@ -70,24 +70,25 @@ GEM
|
|
70
70
|
varia_model (~> 0.6)
|
71
71
|
buff-extensions (2.0.0)
|
72
72
|
buff-ignore (1.2.0)
|
73
|
-
buff-ruby_engine (
|
74
|
-
buff-shell_out (
|
75
|
-
buff-ruby_engine (~>
|
73
|
+
buff-ruby_engine (1.0.0)
|
74
|
+
buff-shell_out (1.1.0)
|
75
|
+
buff-ruby_engine (~> 1.0)
|
76
76
|
builder (3.2.2)
|
77
77
|
celluloid (0.16.0)
|
78
78
|
timers (~> 4.0.0)
|
79
79
|
celluloid-io (0.16.2)
|
80
80
|
celluloid (>= 0.16.0)
|
81
81
|
nio4r (>= 1.1.0)
|
82
|
-
chef-config (12.
|
83
|
-
|
82
|
+
chef-config (12.14.60)
|
83
|
+
addressable
|
84
|
+
fuzzyurl
|
84
85
|
mixlib-config (~> 2.0)
|
85
86
|
mixlib-shellout (~> 2.0)
|
86
|
-
chef-zero (
|
87
|
+
chef-zero (5.1.0)
|
87
88
|
ffi-yajl (~> 2.2)
|
88
89
|
hashie (>= 2.0, < 4.0)
|
89
90
|
mixlib-log (~> 1.3)
|
90
|
-
rack (
|
91
|
+
rack (~> 2.0)
|
91
92
|
uuidtools (~> 2.1)
|
92
93
|
childprocess (0.5.9)
|
93
94
|
ffi (~> 1.0, >= 1.0.11)
|
@@ -119,7 +120,7 @@ GEM
|
|
119
120
|
descendants_tracker (0.0.4)
|
120
121
|
thread_safe (~> 0.3, >= 0.3.1)
|
121
122
|
diff-lcs (1.2.5)
|
122
|
-
domain_name (0.5.
|
123
|
+
domain_name (0.5.20160826)
|
123
124
|
unf (>= 0.0.5, < 1.0.0)
|
124
125
|
enumerable-lazy (0.0.1)
|
125
126
|
equalizer (0.0.11)
|
@@ -127,21 +128,20 @@ GEM
|
|
127
128
|
faraday (0.9.2)
|
128
129
|
multipart-post (>= 1.2, < 3)
|
129
130
|
ffi (1.9.14)
|
130
|
-
ffi (1.9.14-x86-mingw32)
|
131
131
|
ffi-yajl (2.3.0)
|
132
132
|
libyajl2 (~> 1.2)
|
133
133
|
formatador (0.2.5)
|
134
|
-
fuubar (2.
|
135
|
-
rspec (~> 3.0)
|
134
|
+
fuubar (2.2.0)
|
135
|
+
rspec-core (~> 3.0)
|
136
136
|
ruby-progressbar (~> 1.4)
|
137
|
-
fuzzyurl (0.
|
137
|
+
fuzzyurl (0.9.0)
|
138
138
|
gherkin (4.0.0)
|
139
|
-
github_api (0.14.
|
139
|
+
github_api (0.14.5)
|
140
140
|
addressable (~> 2.4.0)
|
141
141
|
descendants_tracker (~> 0.0.4)
|
142
142
|
faraday (~> 0.8, < 0.10)
|
143
143
|
hashie (>= 3.4)
|
144
|
-
oauth2 (~> 1.0
|
144
|
+
oauth2 (~> 1.0)
|
145
145
|
github_changelog_generator (1.11.3)
|
146
146
|
bundler (>= 1.7)
|
147
147
|
colorize (~> 0.7)
|
@@ -199,7 +199,7 @@ GEM
|
|
199
199
|
domain_name (~> 0.5)
|
200
200
|
http-form_data (1.0.1)
|
201
201
|
http_parser.rb (0.6.0)
|
202
|
-
httpclient (2.8.
|
202
|
+
httpclient (2.8.2.4)
|
203
203
|
i18n (0.7.0)
|
204
204
|
ice_nine (0.11.2)
|
205
205
|
iniparse (1.4.2)
|
@@ -218,20 +218,16 @@ GEM
|
|
218
218
|
mixlib-log
|
219
219
|
mixlib-authentication (1.4.1)
|
220
220
|
mixlib-log
|
221
|
-
mixlib-config (2.2.
|
221
|
+
mixlib-config (2.2.4)
|
222
222
|
mixlib-install (1.1.0)
|
223
223
|
artifactory
|
224
224
|
mixlib-shellout
|
225
225
|
mixlib-versioning
|
226
|
-
mixlib-log (1.7.
|
227
|
-
mixlib-shellout (2.2.
|
228
|
-
mixlib-shellout (2.2.6-universal-mingw32)
|
229
|
-
win32-process (~> 0.8.2)
|
230
|
-
wmi-lite (~> 1.0)
|
226
|
+
mixlib-log (1.7.1)
|
227
|
+
mixlib-shellout (2.2.7)
|
231
228
|
mixlib-versioning (1.1.0)
|
232
|
-
molinillo (0.5.
|
229
|
+
molinillo (0.5.1)
|
233
230
|
msgpack (1.0.0)
|
234
|
-
msgpack (1.0.0-x86-mingw32)
|
235
231
|
multi_json (1.12.1)
|
236
232
|
multi_test (0.1.2)
|
237
233
|
multi_xml (0.5.5)
|
@@ -242,19 +238,21 @@ GEM
|
|
242
238
|
net-scp (1.2.1)
|
243
239
|
net-ssh (>= 2.6.5)
|
244
240
|
net-ssh (3.2.0)
|
241
|
+
net-ssh-gateway (1.2.0)
|
242
|
+
net-ssh (>= 2.6.5)
|
245
243
|
nio4r (1.2.1)
|
246
244
|
notiffany (0.1.1)
|
247
245
|
nenv (~> 0.1)
|
248
246
|
shellany (~> 0.0)
|
249
|
-
oauth2 (1.
|
247
|
+
oauth2 (1.2.0)
|
250
248
|
faraday (>= 0.8, < 0.10)
|
251
249
|
jwt (~> 1.0)
|
252
250
|
multi_json (~> 1.3)
|
253
251
|
multi_xml (~> 0.5)
|
254
|
-
rack (
|
252
|
+
rack (>= 1.2, < 3)
|
255
253
|
octokit (4.3.0)
|
256
254
|
sawyer (~> 0.7.0, >= 0.5.3)
|
257
|
-
overcommit (0.
|
255
|
+
overcommit (0.36.0)
|
258
256
|
childprocess (~> 0.5.8)
|
259
257
|
iniparse (~> 1.4)
|
260
258
|
parser (2.3.1.2)
|
@@ -264,7 +262,7 @@ GEM
|
|
264
262
|
coderay (~> 1.1.0)
|
265
263
|
method_source (~> 0.8.1)
|
266
264
|
slop (~> 3.4)
|
267
|
-
rack (
|
265
|
+
rack (2.0.1)
|
268
266
|
rack-accept (0.4.5)
|
269
267
|
rack (>= 0.4)
|
270
268
|
rainbow (2.1.0)
|
@@ -279,12 +277,12 @@ GEM
|
|
279
277
|
http_parser.rb (>= 0.6.0)
|
280
278
|
websocket-driver (>= 0.5.1)
|
281
279
|
retryable (2.0.4)
|
282
|
-
ridley (5.
|
280
|
+
ridley (5.1.0)
|
283
281
|
addressable
|
284
282
|
buff-config (~> 2.0)
|
285
283
|
buff-extensions (~> 2.0)
|
286
284
|
buff-ignore (~> 1.2)
|
287
|
-
buff-shell_out (~> 0
|
285
|
+
buff-shell_out (~> 1.0)
|
288
286
|
celluloid (~> 0.16.0)
|
289
287
|
celluloid-io (~> 0.16.1)
|
290
288
|
chef-config (>= 12.5.0)
|
@@ -301,7 +299,7 @@ GEM
|
|
301
299
|
rspec-core (~> 3.5.0)
|
302
300
|
rspec-expectations (~> 3.5.0)
|
303
301
|
rspec-mocks (~> 3.5.0)
|
304
|
-
rspec-core (3.5.
|
302
|
+
rspec-core (3.5.3)
|
305
303
|
rspec-support (~> 3.5.0)
|
306
304
|
rspec-expectations (3.5.0)
|
307
305
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -329,11 +327,12 @@ GEM
|
|
329
327
|
molinillo (~> 0.4)
|
330
328
|
semverse (>= 1.1, < 3.0)
|
331
329
|
spork (0.9.2)
|
332
|
-
test-kitchen (1.
|
330
|
+
test-kitchen (1.12.0)
|
333
331
|
mixlib-install (~> 1.0, >= 1.0.4)
|
334
332
|
mixlib-shellout (>= 1.2, < 3.0)
|
335
333
|
net-scp (~> 1.1)
|
336
334
|
net-ssh (>= 2.9, < 4.0)
|
335
|
+
net-ssh-gateway (~> 1.2.0)
|
337
336
|
safe_yaml (~> 1.0)
|
338
337
|
thor (~> 0.18)
|
339
338
|
thor (0.19.1)
|
@@ -345,8 +344,7 @@ GEM
|
|
345
344
|
unf (0.1.4)
|
346
345
|
unf_ext
|
347
346
|
unf_ext (0.0.7.2)
|
348
|
-
|
349
|
-
unicode-display_width (1.1.0)
|
347
|
+
unicode-display_width (1.1.1)
|
350
348
|
unicode_utils (1.4.0)
|
351
349
|
uuidtools (2.1.5)
|
352
350
|
varia_model (0.6.0)
|
@@ -364,14 +362,10 @@ GEM
|
|
364
362
|
websocket-driver (0.6.4)
|
365
363
|
websocket-extensions (>= 0.1.0)
|
366
364
|
websocket-extensions (0.1.2)
|
367
|
-
win32-process (0.8.3)
|
368
|
-
ffi (>= 1.0.0)
|
369
|
-
wmi-lite (1.0.0)
|
370
365
|
yard (0.9.5)
|
371
366
|
|
372
367
|
PLATFORMS
|
373
368
|
ruby
|
374
|
-
x86-mingw32
|
375
369
|
|
376
370
|
DEPENDENCIES
|
377
371
|
activesupport (~> 4.0)
|
data/Rakefile
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
|
3
|
+
begin
|
4
|
+
require "rspec/core/rake_task"
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
6
|
+
rescue LoadError
|
7
|
+
puts "Rspec not available"
|
8
|
+
task :spec
|
9
|
+
end
|
10
|
+
|
11
|
+
WINDOWS_PLATFORM = /mswin|win32|mingw/ unless defined? WINDOWS_PLATFORM
|
12
|
+
|
13
|
+
begin
|
14
|
+
require "cucumber"
|
15
|
+
require "cucumber/rake/task"
|
16
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
17
|
+
if RUBY_PLATFORM =~ WINDOWS_PLATFORM
|
18
|
+
t.cucumber_opts = "--tags ~@not-windows"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
rescue LoadError
|
22
|
+
task :features
|
23
|
+
end
|
24
|
+
|
3
25
|
begin
|
4
26
|
require "github_changelog_generator/task"
|
5
27
|
|
@@ -12,3 +34,10 @@ begin
|
|
12
34
|
end
|
13
35
|
rescue LoadError
|
14
36
|
end
|
37
|
+
|
38
|
+
task default: [:spec, :features]
|
39
|
+
task :ci do
|
40
|
+
ENV["CI"] = "true"
|
41
|
+
Rake::Task[:spec].invoke
|
42
|
+
Rake::Task[:features].invoke
|
43
|
+
end
|
data/appveyor.yml
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
version: "master-{build}"
|
2
|
+
|
3
|
+
os: Windows Server 2012 R2
|
4
|
+
platform:
|
5
|
+
- x64
|
6
|
+
|
7
|
+
clone_depth: 1
|
8
|
+
skip_tags: true
|
9
|
+
skip_branch_with_pr: true
|
10
|
+
branches:
|
11
|
+
only:
|
12
|
+
- master
|
13
|
+
|
14
|
+
# caching vendor/bundle appears to break horribly in the face of gems checked out of git
|
15
|
+
# cache:
|
16
|
+
# - vendor/bundle
|
17
|
+
|
18
|
+
install:
|
19
|
+
- ps: iex (irm https://omnitruck.chef.io/install.ps1); Install-Project -Project chefdk -channel current
|
20
|
+
- bundle config --local path vendor/bundle
|
21
|
+
- SET CI=true
|
22
|
+
- SET BUNDLE_WITHOUT=guard:changelog:style
|
23
|
+
|
24
|
+
build_script:
|
25
|
+
- ps: c:\opscode\chefdk\bin\chef.bat shell-init powershell | iex
|
26
|
+
- bundle install || bundle install || bundle install
|
27
|
+
|
28
|
+
test_script:
|
29
|
+
- SET SPEC_OPTS=--format progress
|
30
|
+
- c:\opscode\chefdk\bin\chef.bat exec bundle exec rake spec
|
31
|
+
- c:\opscode\chefdk\bin\chef.bat exec bundle exec cucumber --tags ~@not-windows
|
data/berkshelf.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
|
|
34
34
|
s.add_dependency 'berkshelf-api-client', '>= 2.0.2', '< 4.0'
|
35
35
|
s.add_dependency 'buff-config', '~> 2.0'
|
36
36
|
s.add_dependency 'buff-extensions', '~> 2.0'
|
37
|
-
s.add_dependency 'buff-shell_out', '~> 0
|
37
|
+
s.add_dependency 'buff-shell_out', '~> 1.0'
|
38
38
|
s.add_dependency 'cleanroom', '~> 1.0'
|
39
39
|
s.add_dependency 'faraday', '~> 0.9'
|
40
40
|
s.add_dependency 'httpclient', '~> 2.7'
|
@@ -204,7 +204,7 @@ Feature: berks install
|
|
204
204
|
And the output should contain:
|
205
205
|
"""
|
206
206
|
Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at master)
|
207
|
-
Fetching cookbook index from http://
|
207
|
+
Fetching cookbook index from http://127.0.0.1:26210...
|
208
208
|
Using berkshelf-cookbook-fixture (1.0.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at master)
|
209
209
|
"""
|
210
210
|
|
@@ -235,7 +235,7 @@ Feature: berks install
|
|
235
235
|
And the output should contain:
|
236
236
|
"""
|
237
237
|
Fetching 'berkshelf-cookbook-fixture' from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at rel/cookbooks/berkshelf-cookbook-fixture)
|
238
|
-
Fetching cookbook index from http://
|
238
|
+
Fetching cookbook index from http://127.0.0.1:26210...
|
239
239
|
Using berkshelf-cookbook-fixture (1.0.0) from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at rel/cookbooks/berkshelf-cookbook-fixture)
|
240
240
|
"""
|
241
241
|
|
@@ -263,7 +263,7 @@ Feature: berks install
|
|
263
263
|
And the output should contain:
|
264
264
|
"""
|
265
265
|
Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
|
266
|
-
Fetching cookbook index from http://
|
266
|
+
Fetching cookbook index from http://127.0.0.1:26210...
|
267
267
|
Using berkshelf-cookbook-fixture (0.2.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
|
268
268
|
"""
|
269
269
|
|
@@ -278,7 +278,7 @@ Feature: berks install
|
|
278
278
|
And the output should contain:
|
279
279
|
"""
|
280
280
|
Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at 70a527e)
|
281
|
-
Fetching cookbook index from http://
|
281
|
+
Fetching cookbook index from http://127.0.0.1:26210...
|
282
282
|
Using berkshelf-cookbook-fixture (0.2.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at 70a527e)
|
283
283
|
"""
|
284
284
|
|
@@ -293,7 +293,7 @@ Feature: berks install
|
|
293
293
|
And the output should contain:
|
294
294
|
"""
|
295
295
|
Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at 70a527e)
|
296
|
-
Fetching cookbook index from http://
|
296
|
+
Fetching cookbook index from http://127.0.0.1:26210...
|
297
297
|
Using berkshelf-cookbook-fixture (0.2.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at 70a527e)
|
298
298
|
"""
|
299
299
|
|
@@ -308,7 +308,7 @@ Feature: berks install
|
|
308
308
|
And the output should contain:
|
309
309
|
"""
|
310
310
|
Fetching 'berkshelf-cookbook-fixture' from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
|
311
|
-
Fetching cookbook index from http://
|
311
|
+
Fetching cookbook index from http://127.0.0.1:26210...
|
312
312
|
Using berkshelf-cookbook-fixture (0.2.0) from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
|
313
313
|
"""
|
314
314
|
|
@@ -323,7 +323,7 @@ Feature: berks install
|
|
323
323
|
And the output should contain:
|
324
324
|
"""
|
325
325
|
Fetching 'berkshelf-cookbook-fixture' from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
|
326
|
-
Fetching cookbook index from http://
|
326
|
+
Fetching cookbook index from http://127.0.0.1:26210...
|
327
327
|
Using berkshelf-cookbook-fixture (0.2.0) from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
|
328
328
|
"""
|
329
329
|
|
@@ -476,7 +476,7 @@ Feature: berks install
|
|
476
476
|
Then the output should contain:
|
477
477
|
"""
|
478
478
|
Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v1.0.0)
|
479
|
-
Fetching cookbook index from http://
|
479
|
+
Fetching cookbook index from http://127.0.0.1:26210...
|
480
480
|
Using berkshelf-cookbook-fixture (1.0.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v1.0.0)
|
481
481
|
"""
|
482
482
|
|
@@ -8,9 +8,10 @@ Feature: berks search
|
|
8
8
|
|
9
9
|
Scenario: Searching for a cookbook by partial name
|
10
10
|
* I successfully run `berks search berkshelf-`
|
11
|
-
* the
|
11
|
+
* the results should have the cookbooks:
|
12
12
|
"""
|
13
13
|
berkshelf-api (1.2.2)
|
14
14
|
berkshelf-api-server (2.2.0)
|
15
15
|
berkshelf-cookbook-fixture (1.0.0)
|
16
16
|
"""
|
17
|
+
* the results should each start with "berkshelf-"
|
@@ -59,7 +59,9 @@ Feature: berks shelf uninstall
|
|
59
59
|
| fake | 1.2.0 |
|
60
60
|
| fake | 2.0.0 |
|
61
61
|
|
62
|
-
|
62
|
+
# FIXME: there seems to be a bug in aruba on windows related to
|
63
|
+
# interactive stuff that i fully don't understand
|
64
|
+
@spawn @not-windows
|
63
65
|
Scenario: With contingencies
|
64
66
|
Given the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
|
65
67
|
| ekaf | 2.3.4 |
|
@@ -28,7 +28,7 @@ Feature: Vendoring cookbooks to a directory
|
|
28
28
|
metadata
|
29
29
|
"""
|
30
30
|
When I successfully run `berks vendor cukebooks`
|
31
|
-
|
31
|
+
Then the directory "cukebooks/fake" should contain version "0.0.0" of the "fake" cookbook
|
32
32
|
|
33
33
|
Scenario: vendoring a cookbook with transitive dependencies
|
34
34
|
Given I have a Berksfile pointing at the local Berkshelf API with:
|
@@ -86,7 +86,7 @@ Feature: Vendoring cookbooks to a directory
|
|
86
86
|
cookbook 'fake'
|
87
87
|
"""
|
88
88
|
When I successfully run `berks vendor`
|
89
|
-
|
89
|
+
Then the directory "berks-cookbooks/fake" should contain version "1.0.0" of the "fake" cookbook
|
90
90
|
|
91
91
|
Scenario: vendoring to a directory that already exists
|
92
92
|
Given I have a Berksfile pointing at the local Berkshelf API with:
|
@@ -96,8 +96,8 @@ Feature: Vendoring cookbooks to a directory
|
|
96
96
|
And a directory named "cukebooks"
|
97
97
|
And a directory named "cukebooks/fake/ponies"
|
98
98
|
And a directory named "cukebooks/existing_cookbook"
|
99
|
-
When I successfully run `berks vendor cukebooks`
|
100
|
-
|
99
|
+
When I successfully run `berks vendor --delete cukebooks`
|
100
|
+
Then the directory "cukebooks/fake" should contain version "1.0.0" of the "fake" cookbook
|
101
101
|
And a directory named "cukebooks/fake/ponies" should not exist
|
102
102
|
And a directory named "cukebooks/existing_cookbook" should not exist
|
103
103
|
|
@@ -18,7 +18,7 @@ Feature: --format json
|
|
18
18
|
{
|
19
19
|
"cookbooks": [
|
20
20
|
{
|
21
|
-
"api_source": "http://
|
21
|
+
"api_source": "http://127.0.0.1:26210/",
|
22
22
|
"location_path": "http://localhost:26310/",
|
23
23
|
"version": "1.0.0",
|
24
24
|
"name": "berkshelf"
|
@@ -27,7 +27,7 @@ Feature: --format json
|
|
27
27
|
"errors": [],
|
28
28
|
"messages": [
|
29
29
|
"Resolving cookbook dependencies...",
|
30
|
-
"Fetching cookbook index from http://
|
30
|
+
"Fetching cookbook index from http://127.0.0.1:26210..."
|
31
31
|
],
|
32
32
|
"warnings": []
|
33
33
|
}
|
@@ -53,7 +53,7 @@ Feature: --format json
|
|
53
53
|
"errors": [],
|
54
54
|
"messages": [
|
55
55
|
"Resolving cookbook dependencies...",
|
56
|
-
"Fetching cookbook index from http://
|
56
|
+
"Fetching cookbook index from http://127.0.0.1:26210..."
|
57
57
|
],
|
58
58
|
"warnings": []
|
59
59
|
}
|
@@ -149,7 +149,7 @@ Feature: --format json
|
|
149
149
|
{
|
150
150
|
"local": "0.1.0",
|
151
151
|
"remote": {
|
152
|
-
"http://
|
152
|
+
"http://127.0.0.1:26210/": "0.2.9"
|
153
153
|
},
|
154
154
|
"name": "seth"
|
155
155
|
}
|
@@ -31,7 +31,7 @@ Given /^I have a Berksfile at "(.+)" pointing at the local Berkshelf API with:$/
|
|
31
31
|
Given a directory named "#{path}"
|
32
32
|
And a file named "#{path}/Berksfile" with:
|
33
33
|
"""
|
34
|
-
source 'http://
|
34
|
+
source 'http://127.0.0.1:#{BERKS_API_PORT}'
|
35
35
|
|
36
36
|
#{content}
|
37
37
|
"""
|
@@ -2,3 +2,17 @@ Then /^the exit status should be "(.+)"$/ do |name|
|
|
2
2
|
error = name.split('::').reduce(Berkshelf) { |klass, id| klass.const_get(id) }
|
3
3
|
expect(last_command_started).to have_exit_status(error.status_code)
|
4
4
|
end
|
5
|
+
|
6
|
+
Then /^the results should have the cookbooks:$/ do |cookbooks|
|
7
|
+
list = last_command_started.stdout
|
8
|
+
cookbooks.split("\n").each do |cookbook|
|
9
|
+
expect(list).to include(cookbook)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
Then /^the results should each start with "(.+)"$/ do |prefix|
|
14
|
+
list = last_command_started.stdout
|
15
|
+
list.split("\n").each do |cookbook|
|
16
|
+
expect(cookbook).to start_with(prefix)
|
17
|
+
end
|
18
|
+
end
|
data/lib/berkshelf/berksfile.rb
CHANGED
@@ -9,7 +9,7 @@ module Berkshelf
|
|
9
9
|
# @param (see Berksfile#initialize)
|
10
10
|
def from_options(options = {})
|
11
11
|
options[:berksfile] ||= File.join(Dir.pwd, Berkshelf::DEFAULT_FILENAME)
|
12
|
-
from_file(options[:berksfile], options.slice(:except, :only))
|
12
|
+
from_file(options[:berksfile], options.slice(:except, :only, :delete))
|
13
13
|
end
|
14
14
|
|
15
15
|
# @param [#to_s] file
|
@@ -64,6 +64,7 @@ module Berkshelf
|
|
64
64
|
@filepath = File.expand_path(path)
|
65
65
|
@dependencies = Hash.new
|
66
66
|
@sources = Hash.new
|
67
|
+
@delete = options[:delete]
|
67
68
|
|
68
69
|
# defaults for what solvers to use
|
69
70
|
@required_solver = nil
|
@@ -668,7 +669,7 @@ module Berkshelf
|
|
668
669
|
#
|
669
670
|
# * https://tickets.opscode.com/browse/CHEF-4811
|
670
671
|
# * https://tickets.opscode.com/browse/CHEF-4810
|
671
|
-
FileSyncer.sync(scratch, destination, exclude: raw_metadata_files + EXCLUDED_VCS_FILES_WHEN_VENDORING)
|
672
|
+
FileSyncer.sync(scratch, destination, exclude: raw_metadata_files + EXCLUDED_VCS_FILES_WHEN_VENDORING, delete: @delete)
|
672
673
|
end
|
673
674
|
|
674
675
|
destination
|
data/lib/berkshelf/cli.rb
CHANGED
@@ -184,7 +184,7 @@ module Berkshelf
|
|
184
184
|
method_option :force,
|
185
185
|
type: :boolean,
|
186
186
|
default: false,
|
187
|
-
desc: 'Upload all
|
187
|
+
desc: 'Upload all cookbooks even if a frozen one exists on the Chef Server.'
|
188
188
|
method_option :ssl_verify,
|
189
189
|
type: :boolean,
|
190
190
|
default: nil,
|
@@ -379,6 +379,10 @@ EOF
|
|
379
379
|
type: :array,
|
380
380
|
desc: 'Exclude cookbooks that are in these groups.',
|
381
381
|
aliases: '-e'
|
382
|
+
method_option :delete,
|
383
|
+
type: :boolean,
|
384
|
+
desc: "Clean the target directory before vendoring",
|
385
|
+
default: false
|
382
386
|
method_option :only,
|
383
387
|
type: :array,
|
384
388
|
desc: 'Only cookbooks that are in these groups.',
|
data/lib/berkshelf/config.rb
CHANGED
@@ -2,12 +2,21 @@ require 'fileutils'
|
|
2
2
|
|
3
3
|
module FileUtils
|
4
4
|
class << self
|
5
|
-
|
6
|
-
|
5
|
+
alias_method :old_mv, :mv
|
6
|
+
|
7
|
+
# If we encounter Errno::EACCES, which seems to happen occasionally on Windows,
|
8
|
+
# try to copy and delete the file instead of moving it.
|
9
|
+
#
|
10
|
+
# @see https://github.com/berkshelf/berkshelf/issues/140
|
11
|
+
# @see http://www.ruby-forum.com/topic/1044813
|
7
12
|
#
|
13
|
+
# It's also possible that we get Errno::ENOENT if we try to `mv` a relative
|
14
|
+
# symlink on Linux
|
8
15
|
# @see {FileUtils::mv}
|
9
|
-
# @see {safe_mv}
|
10
16
|
def mv(src, dest, options = {})
|
17
|
+
old_mv(src, dest, options)
|
18
|
+
rescue Errno::EACCES, Errno::ENOENT
|
19
|
+
options.delete(:force) if options.has_key?(:force)
|
11
20
|
FileUtils.cp_r(src, dest, options)
|
12
21
|
FileUtils.rm_rf(src)
|
13
22
|
end
|
@@ -58,6 +58,11 @@ module Berkshelf
|
|
58
58
|
[exclude, "#{exclude}/*"]
|
59
59
|
end.flatten
|
60
60
|
|
61
|
+
# let glob expand the source directory in case it is an abbreviated windows
|
62
|
+
# user directory: C:/Users/MATTWR~1/AppData/Local/Temp
|
63
|
+
# so that it matches the parent of source_files
|
64
|
+
source = glob(source).first
|
65
|
+
|
61
66
|
source_files = glob(File.join(source, '**/*'))
|
62
67
|
source_files = source_files.reject do |source_file|
|
63
68
|
basename = relative_path_for(source_file, source)
|
@@ -95,23 +100,25 @@ module Berkshelf
|
|
95
100
|
end
|
96
101
|
end
|
97
102
|
|
98
|
-
|
99
|
-
|
103
|
+
if options[:delete]
|
104
|
+
# Remove any files in the destination that are not in the source files
|
105
|
+
destination_files = glob("#{destination}/**/*")
|
100
106
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
107
|
+
# Calculate the relative paths of files so we can compare to the
|
108
|
+
# source.
|
109
|
+
relative_source_files = source_files.map do |file|
|
110
|
+
relative_path_for(file, source)
|
111
|
+
end
|
112
|
+
relative_destination_files = destination_files.map do |file|
|
113
|
+
relative_path_for(file, destination)
|
114
|
+
end
|
109
115
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
116
|
+
# Remove any extra files that are present in the destination, but are
|
117
|
+
# not in the source list
|
118
|
+
extra_files = relative_destination_files - relative_source_files
|
119
|
+
extra_files.each do |file|
|
120
|
+
FileUtils.rm_rf(File.join(destination, file))
|
121
|
+
end
|
115
122
|
end
|
116
123
|
|
117
124
|
true
|
data/lib/berkshelf/source.rb
CHANGED
@@ -17,12 +17,17 @@ module Berkshelf
|
|
17
17
|
if source == :chef_server
|
18
18
|
APIClient.chef_server(
|
19
19
|
ssl: {verify: Berkshelf::Config.instance.ssl.verify},
|
20
|
+
timeout: api_timeout,
|
21
|
+
open_timeout: [(api_timeout / 10), 3].max,
|
20
22
|
client_name: Berkshelf::Config.instance.chef.node_name,
|
21
23
|
server_url: Berkshelf::Config.instance.chef.chef_server_url,
|
22
24
|
client_key: Berkshelf::Config.instance.chef.client_key,
|
23
25
|
)
|
24
26
|
else
|
25
|
-
APIClient.new(uri,
|
27
|
+
APIClient.new(uri,
|
28
|
+
timeout: api_timeout,
|
29
|
+
open_timeout: [(api_timeout / 10), 3].max,
|
30
|
+
ssl: {verify: Berkshelf::Config.instance.ssl.verify})
|
26
31
|
end
|
27
32
|
end
|
28
33
|
end
|
@@ -117,5 +122,10 @@ module Berkshelf
|
|
117
122
|
uri == other.uri
|
118
123
|
end
|
119
124
|
|
125
|
+
private
|
126
|
+
|
127
|
+
def api_timeout
|
128
|
+
Berkshelf::Config.instance.api.timeout.to_i
|
129
|
+
end
|
120
130
|
end
|
121
131
|
end
|
data/lib/berkshelf/version.rb
CHANGED
@@ -390,21 +390,21 @@ describe Berkshelf::Berksfile do
|
|
390
390
|
let(:raw_metadata_files) { [File::join(cached_cookbook.cookbook_name, 'metadata.rb')] }
|
391
391
|
|
392
392
|
let(:destination) { '/a/destination/path' }
|
393
|
-
let(:
|
393
|
+
let(:options) { { :exclude => raw_metadata_files + Berkshelf::Berksfile::EXCLUDED_VCS_FILES_WHEN_VENDORING, delete: nil } }
|
394
394
|
|
395
395
|
before do
|
396
396
|
allow(Berkshelf::Installer).to receive(:new).and_return(installer)
|
397
397
|
end
|
398
398
|
|
399
399
|
it 'invokes FileSyncer with correct arguments' do
|
400
|
-
expect(Berkshelf::FileSyncer).to receive(:sync).with(/vendor/, destination,
|
400
|
+
expect(Berkshelf::FileSyncer).to receive(:sync).with(/vendor/, destination, options)
|
401
401
|
|
402
402
|
subject.vendor(destination)
|
403
403
|
end
|
404
404
|
|
405
405
|
it 'excludes the top-level metadata.rb file' do
|
406
|
-
expect(
|
407
|
-
expect(
|
406
|
+
expect(options[:exclude].any? { |exclude| File.fnmatch?(exclude, 'my_cookbook/recipes/metadata.rb', File::FNM_DOTMATCH) }).to be(false)
|
407
|
+
expect(options[:exclude].any? { |exclude| File.fnmatch?(exclude, 'my_cookbook/metadata.rb', File::FNM_DOTMATCH) }).to be(true)
|
408
408
|
end
|
409
409
|
end
|
410
410
|
|
@@ -15,6 +15,12 @@ describe Berkshelf::Config do
|
|
15
15
|
it 'should be a Berkshelf::Config' do
|
16
16
|
expect(Berkshelf::Config.instance).to be_an_instance_of(Berkshelf::Config)
|
17
17
|
end
|
18
|
+
|
19
|
+
context 'attributes' do
|
20
|
+
it 'should have a default API timeout' do
|
21
|
+
expect(Berkshelf::Config.instance.api.timeout).to eq('30')
|
22
|
+
end
|
23
|
+
end
|
18
24
|
end
|
19
25
|
|
20
26
|
describe '::path' do
|
@@ -2,12 +2,17 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe FileUtils do
|
4
4
|
describe '#mv' do
|
5
|
-
let(:src) {
|
6
|
-
let(:dest) {
|
7
|
-
let(:options) {
|
5
|
+
let(:src) { 'src' }
|
6
|
+
let(:dest) { 'dest' }
|
7
|
+
let(:options) { {} }
|
8
|
+
|
9
|
+
it "uses mv by default" do
|
10
|
+
expect(FileUtils).to receive(:old_mv).with(src, dest, options)
|
11
|
+
FileUtils.mv(src, dest, options)
|
12
|
+
end
|
13
|
+
|
8
14
|
|
9
15
|
it 'replaces mv with cp_r and rm_rf' do
|
10
|
-
allow(subject).to receive(:windows?) { true }
|
11
16
|
expect(FileUtils).to receive(:cp_r).with(src, dest, options)
|
12
17
|
expect(FileUtils).to receive(:rm_rf).with(src)
|
13
18
|
|
@@ -117,7 +117,7 @@ module Berkshelf
|
|
117
117
|
context 'when the directory exists' do
|
118
118
|
before { FileUtils.mkdir_p(destination) }
|
119
119
|
|
120
|
-
it '
|
120
|
+
it 'does not delete existing files and folders' do
|
121
121
|
FileUtils.mkdir_p("#{destination}/existing_folder")
|
122
122
|
FileUtils.mkdir_p("#{destination}/.existing_folder")
|
123
123
|
FileUtils.touch("#{destination}/existing_file")
|
@@ -133,6 +133,28 @@ module Berkshelf
|
|
133
133
|
expect("#{destination}/.dot_folder/file_f").to be_a_file
|
134
134
|
expect("#{destination}/.file_g").to be_a_file
|
135
135
|
|
136
|
+
expect("#{destination}/existing_folder").to be_a_directory
|
137
|
+
expect("#{destination}/.existing_folder").to be_a_directory
|
138
|
+
expect("#{destination}/existing_file").to be_a_file
|
139
|
+
expect("#{destination}/.existing_file").to be_a_file
|
140
|
+
end
|
141
|
+
|
142
|
+
it 'optionally deletes existing files and folders' do
|
143
|
+
FileUtils.mkdir_p("#{destination}/existing_folder")
|
144
|
+
FileUtils.mkdir_p("#{destination}/.existing_folder")
|
145
|
+
FileUtils.touch("#{destination}/existing_file")
|
146
|
+
FileUtils.touch("#{destination}/.existing_file")
|
147
|
+
|
148
|
+
described_class.sync(source, destination, delete: true)
|
149
|
+
|
150
|
+
expect("#{destination}/file_a").to be_a_file
|
151
|
+
expect("#{destination}/file_b").to be_a_file
|
152
|
+
expect("#{destination}/file_c").to be_a_file
|
153
|
+
expect("#{destination}/folder/file_d").to be_a_file
|
154
|
+
expect("#{destination}/folder/file_e").to be_a_file
|
155
|
+
expect("#{destination}/.dot_folder/file_f").to be_a_file
|
156
|
+
expect("#{destination}/.file_g").to be_a_file
|
157
|
+
|
136
158
|
expect("#{destination}/existing_folder").to_not be_a_directory
|
137
159
|
expect("#{destination}/.existing_folder").to_not be_a_directory
|
138
160
|
expect("#{destination}/existing_file").to_not be_a_file
|
@@ -288,7 +310,7 @@ module Berkshelf
|
|
288
310
|
FileUtils.mkdir_p("#{destination}/.dot_folder")
|
289
311
|
FileUtils.touch("#{destination}/.dot_folder/file_f")
|
290
312
|
|
291
|
-
described_class.sync(source, destination, exclude: '.dot_folder')
|
313
|
+
described_class.sync(source, destination, delete: true, exclude: '.dot_folder')
|
292
314
|
|
293
315
|
expect("#{destination}/file_a").to be_a_file
|
294
316
|
expect("#{destination}/file_b").to be_a_file
|
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: 5.
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Winsor
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2016-
|
15
|
+
date: 2016-09-16 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: addressable
|
@@ -88,14 +88,14 @@ dependencies:
|
|
88
88
|
requirements:
|
89
89
|
- - "~>"
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: '0
|
91
|
+
version: '1.0'
|
92
92
|
type: :runtime
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - "~>"
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: '0
|
98
|
+
version: '1.0'
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
name: cleanroom
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
@@ -273,6 +273,7 @@ files:
|
|
273
273
|
- README.md
|
274
274
|
- Rakefile
|
275
275
|
- Thorfile
|
276
|
+
- appveyor.yml
|
276
277
|
- berkshelf.gemspec
|
277
278
|
- bin/berks
|
278
279
|
- docs/berkshelf_for_newcomers.md
|
@@ -468,7 +469,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
468
469
|
version: 2.0.0
|
469
470
|
requirements: []
|
470
471
|
rubyforge_project:
|
471
|
-
rubygems_version: 2.
|
472
|
+
rubygems_version: 2.6.6
|
472
473
|
signing_key:
|
473
474
|
specification_version: 4
|
474
475
|
summary: Manages a Cookbook's, or an Application's, Cookbook dependencies
|