vagrant-berkshelf 1.2.0 → 1.3.2
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/CONTRIBUTING.md +1 -1
- data/README.md +5 -5
- data/Thorfile +13 -17
- data/lib/berkshelf/vagrant.rb +15 -6
- data/lib/berkshelf/vagrant/action/clean.rb +1 -1
- data/lib/berkshelf/vagrant/action/load_shelf.rb +10 -7
- data/lib/berkshelf/vagrant/env_helpers.rb +2 -2
- data/lib/berkshelf/vagrant/version.rb +1 -1
- data/spec/unit/berkshelf/vagrant_spec.rb +10 -2
- data/vagrant-berkshelf.gemspec +11 -12
- metadata +32 -27
- checksums.yaml +0 -15
data/CONTRIBUTING.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# vagrant-berkshelf
|
2
2
|
[](http://badge.fury.io/rb/vagrant-berkshelf)
|
3
3
|
[](https://travis-ci.org/RiotGames/vagrant-berkshelf)
|
4
4
|
[](https://gemnasium.com/RiotGames/vagrant-berkshelf)
|
@@ -8,16 +8,15 @@ A Vagrant plugin to add Berkshelf integration to the Chef provisioners
|
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
11
|
-
Install Vagrant 1.
|
11
|
+
Install Vagrant 1.2.x from the [Vagrant downloads page](http://downloads.vagrantup.com/)
|
12
12
|
|
13
|
-
Install the Berkshelf
|
13
|
+
Install the Vagrant Berkshelf plugin
|
14
14
|
|
15
15
|
$ vagrant plugin install vagrant-berkshelf
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
19
|
-
Once the Berkshelf
|
20
|
-
|
19
|
+
Once the Vagrant Berkshelf plugin is installed it can be enabled in your Vagrantfile
|
21
20
|
|
22
21
|
Vagrant.configure("2") do |config|
|
23
22
|
...
|
@@ -29,6 +28,7 @@ The plugin will look in your current working directory for your `Berksfile` by d
|
|
29
28
|
|
30
29
|
# Authors
|
31
30
|
- Jamie Winsor (<reset@riotgames.com>)
|
31
|
+
- Michael Ivey (<michael.ivey@riotgames.com>)
|
32
32
|
|
33
33
|
Thank you to all of our [Contributors](https://github.com/RiotGames/vagrant-berkshelf/graphs/contributors), testers, and users.
|
34
34
|
|
data/Thorfile
CHANGED
@@ -8,26 +8,22 @@ require 'thor/rake_compat'
|
|
8
8
|
require 'berkshelf/vagrant'
|
9
9
|
|
10
10
|
class Default < Thor
|
11
|
-
|
12
|
-
|
13
|
-
Bundler::GemHelper.install_tasks
|
11
|
+
include Thor::RakeCompat
|
12
|
+
Bundler::GemHelper.install_tasks
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
Rake::Task["build"].execute
|
20
|
-
end
|
14
|
+
desc "build", "Build vagrant-berkshelf-#{Berkshelf::Vagrant::VERSION}.gem into the pkg directory"
|
15
|
+
def build
|
16
|
+
Rake::Task["build"].execute
|
17
|
+
end
|
21
18
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
desc "release", "Create tag v#{Berkshelf::Vagrant::VERSION} and build and push vagrant-berkshelf-#{Berkshelf::Vagrant::VERSION}.gem to Rubygems"
|
20
|
+
def release
|
21
|
+
Rake::Task["release"].execute
|
22
|
+
end
|
26
23
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
24
|
+
desc "install", "Build and install vagrant-berkshelf-#{Berkshelf::Vagrant::VERSION}.gem into system gems"
|
25
|
+
def install
|
26
|
+
Rake::Task["install"].execute
|
31
27
|
end
|
32
28
|
|
33
29
|
class Spec < Thor
|
data/lib/berkshelf/vagrant.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
begin
|
2
|
-
require
|
2
|
+
require 'vagrant'
|
3
3
|
rescue LoadError
|
4
|
-
raise
|
4
|
+
raise 'The Vagrant Berkshelf plugin must be run within Vagrant.'
|
5
5
|
end
|
6
6
|
|
7
|
+
require 'fileutils'
|
8
|
+
require 'json'
|
9
|
+
require 'tmpdir'
|
10
|
+
|
7
11
|
require 'berkshelf'
|
8
12
|
require 'berkshelf/vagrant/version'
|
9
13
|
require 'berkshelf/vagrant/errors'
|
10
|
-
require 'tmpdir'
|
11
|
-
require 'fileutils'
|
12
14
|
|
13
15
|
module Berkshelf
|
14
16
|
# @author Jamie Winsor <reset@riotgames.com>
|
@@ -31,12 +33,19 @@ module Berkshelf
|
|
31
33
|
#
|
32
34
|
# @return [String]
|
33
35
|
# path to the generated shelf
|
34
|
-
def mkshelf
|
36
|
+
def mkshelf(machine_name = nil)
|
37
|
+
|
35
38
|
unless File.exist?(shelf_path)
|
36
39
|
FileUtils.mkdir_p(shelf_path)
|
37
40
|
end
|
38
41
|
|
39
|
-
|
42
|
+
if machine_name.nil?
|
43
|
+
prefix_suffix = 'berkshelf-'
|
44
|
+
else
|
45
|
+
prefix_suffix = ['berkshelf-', "-#{machine_name}"]
|
46
|
+
end
|
47
|
+
|
48
|
+
Dir.mktmpdir(prefix_suffix, shelf_path)
|
40
49
|
end
|
41
50
|
end
|
42
51
|
end
|
@@ -14,10 +14,13 @@ module Berkshelf
|
|
14
14
|
return @app.call(env)
|
15
15
|
end
|
16
16
|
|
17
|
-
|
17
|
+
# Make sure that Berkshelf itself uses distinct directories for each vagrant run.
|
18
|
+
ENV['BERKSHELF_PATH'] = File.join(Berkshelf.berkshelf_path, env[:machine].name.to_s) unless ENV['BERKSHELF_PATH']
|
19
|
+
|
20
|
+
shelf = load_shelf env
|
18
21
|
|
19
22
|
if shelf.nil?
|
20
|
-
shelf = cache_shelf(Berkshelf::Vagrant.mkshelf)
|
23
|
+
shelf = cache_shelf(Berkshelf::Vagrant.mkshelf(env[:machine].name), env)
|
21
24
|
end
|
22
25
|
|
23
26
|
env[:berkshelf].shelf = shelf
|
@@ -28,10 +31,10 @@ module Berkshelf
|
|
28
31
|
# @param [String] path
|
29
32
|
#
|
30
33
|
# @return [String]
|
31
|
-
def cache_shelf(path)
|
34
|
+
def cache_shelf(path, env)
|
32
35
|
FileUtils.mkdir_p(File.dirname(path))
|
33
36
|
|
34
|
-
File.open(cache_file, 'w+') do |f|
|
37
|
+
File.open((cache_file(env)), 'w+') do |f|
|
35
38
|
f.write(path)
|
36
39
|
end
|
37
40
|
|
@@ -39,10 +42,10 @@ module Berkshelf
|
|
39
42
|
end
|
40
43
|
|
41
44
|
# @return [String, nil]
|
42
|
-
def load_shelf
|
43
|
-
return nil unless File.exist?(cache_file)
|
45
|
+
def load_shelf(env)
|
46
|
+
return nil unless File.exist?(cache_file(env))
|
44
47
|
|
45
|
-
File.read(cache_file).chomp
|
48
|
+
File.read(cache_file(env)).chomp
|
46
49
|
end
|
47
50
|
end
|
48
51
|
end
|
@@ -8,8 +8,8 @@ module Berkshelf
|
|
8
8
|
# Vagrant runs.
|
9
9
|
#
|
10
10
|
# @return [String]
|
11
|
-
def cache_file
|
12
|
-
File.join('.vagrant', 'berkshelf')
|
11
|
+
def cache_file(env)
|
12
|
+
File.join('.vagrant', 'machines', env[:machine].name.to_s, 'berkshelf')
|
13
13
|
end
|
14
14
|
|
15
15
|
# Filter all of the provisioners of the given vagrant environment with the given name
|
@@ -13,13 +13,21 @@ describe Berkshelf::Vagrant do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
describe "::mkshelf" do
|
16
|
+
|
16
17
|
it "returns a String" do
|
17
|
-
subject.mkshelf.should be_a(String)
|
18
|
+
subject.mkshelf().should be_a(String)
|
18
19
|
end
|
19
20
|
|
20
21
|
it "is a pathname including the shelf_path" do
|
21
|
-
subject.mkshelf.should include(subject.shelf_path)
|
22
|
+
subject.mkshelf().should include(subject.shelf_path)
|
22
23
|
end
|
24
|
+
|
25
|
+
it "is a pathname including machine name" do
|
26
|
+
|
27
|
+
machine_name = 'fantastic_machine'
|
28
|
+
subject.mkshelf(machine_name).should include(machine_name)
|
29
|
+
end
|
30
|
+
|
23
31
|
end
|
24
32
|
end
|
25
33
|
end
|
data/vagrant-berkshelf.gemspec
CHANGED
@@ -4,30 +4,29 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'berkshelf/vagrant/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'vagrant-berkshelf'
|
8
8
|
spec.version = Berkshelf::Vagrant::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = [ 'Jamie Winsor', 'Michael Ivey' ]
|
10
|
+
spec.email = [ 'reset@riotgames.com', 'michael.ivey@riotgames.com' ]
|
11
11
|
spec.description = %q{A Vagrant plugin to add Berkshelf integration to the Chef provisioners}
|
12
12
|
spec.summary = spec.description
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
13
|
+
spec.homepage = 'http://berkshelf.com'
|
14
|
+
spec.license = 'Apache 2.0'
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = [
|
20
|
-
spec.required_ruby_version =
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
spec.required_ruby_version = '>= 1.9.1'
|
21
21
|
|
22
|
-
spec.add_dependency 'berkshelf', '~>
|
22
|
+
spec.add_dependency 'berkshelf', '~> 2.0.4'
|
23
23
|
# activesupport 3.2.13 contains an incompatible hard lock on i18n (= 0.6.1)
|
24
24
|
spec.add_dependency 'activesupport', '>= 3.2.0', '< 3.2.13'
|
25
25
|
|
26
26
|
# Explicit locks to ensure we activate the proper gem versions for Vagrant
|
27
|
-
spec.add_dependency
|
28
|
-
spec.add_dependency
|
29
|
-
spec.add_dependency
|
30
|
-
spec.add_dependency "net-scp", "~> 1.1.0"
|
27
|
+
spec.add_dependency 'i18n', '~> 0.6.0'
|
28
|
+
spec.add_dependency 'net-ssh', '~> 2.6.6'
|
29
|
+
spec.add_dependency 'net-scp', '~> 1.1.0'
|
31
30
|
|
32
31
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
33
32
|
spec.add_development_dependency 'spork'
|
metadata
CHANGED
@@ -1,32 +1,37 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-berkshelf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2
|
4
|
+
version: 1.3.2
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Jamie Winsor
|
9
|
+
- Michael Ivey
|
8
10
|
autorequire:
|
9
11
|
bindir: bin
|
10
12
|
cert_chain: []
|
11
|
-
date: 2013-
|
13
|
+
date: 2013-06-17 00:00:00.000000000 Z
|
12
14
|
dependencies:
|
13
15
|
- !ruby/object:Gem::Dependency
|
14
16
|
name: berkshelf
|
15
17
|
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
16
19
|
requirements:
|
17
20
|
- - ~>
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: 2.0.4
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
23
27
|
requirements:
|
24
28
|
- - ~>
|
25
29
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
30
|
+
version: 2.0.4
|
27
31
|
- !ruby/object:Gem::Dependency
|
28
32
|
name: activesupport
|
29
33
|
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
30
35
|
requirements:
|
31
36
|
- - ! '>='
|
32
37
|
- !ruby/object:Gem::Version
|
@@ -37,6 +42,7 @@ dependencies:
|
|
37
42
|
type: :runtime
|
38
43
|
prerelease: false
|
39
44
|
version_requirements: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
40
46
|
requirements:
|
41
47
|
- - ! '>='
|
42
48
|
- !ruby/object:Gem::Version
|
@@ -47,6 +53,7 @@ dependencies:
|
|
47
53
|
- !ruby/object:Gem::Dependency
|
48
54
|
name: i18n
|
49
55
|
requirement: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
50
57
|
requirements:
|
51
58
|
- - ~>
|
52
59
|
- !ruby/object:Gem::Version
|
@@ -54,33 +61,15 @@ dependencies:
|
|
54
61
|
type: :runtime
|
55
62
|
prerelease: false
|
56
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
57
65
|
requirements:
|
58
66
|
- - ~>
|
59
67
|
- !ruby/object:Gem::Version
|
60
68
|
version: 0.6.0
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: json
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - ! '>='
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: 1.5.1
|
68
|
-
- - <
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version: 1.8.0
|
71
|
-
type: :runtime
|
72
|
-
prerelease: false
|
73
|
-
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
requirements:
|
75
|
-
- - ! '>='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: 1.5.1
|
78
|
-
- - <
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: 1.8.0
|
81
69
|
- !ruby/object:Gem::Dependency
|
82
70
|
name: net-ssh
|
83
71
|
requirement: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
84
73
|
requirements:
|
85
74
|
- - ~>
|
86
75
|
- !ruby/object:Gem::Version
|
@@ -88,6 +77,7 @@ dependencies:
|
|
88
77
|
type: :runtime
|
89
78
|
prerelease: false
|
90
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
91
81
|
requirements:
|
92
82
|
- - ~>
|
93
83
|
- !ruby/object:Gem::Version
|
@@ -95,6 +85,7 @@ dependencies:
|
|
95
85
|
- !ruby/object:Gem::Dependency
|
96
86
|
name: net-scp
|
97
87
|
requirement: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
98
89
|
requirements:
|
99
90
|
- - ~>
|
100
91
|
- !ruby/object:Gem::Version
|
@@ -102,6 +93,7 @@ dependencies:
|
|
102
93
|
type: :runtime
|
103
94
|
prerelease: false
|
104
95
|
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
105
97
|
requirements:
|
106
98
|
- - ~>
|
107
99
|
- !ruby/object:Gem::Version
|
@@ -109,6 +101,7 @@ dependencies:
|
|
109
101
|
- !ruby/object:Gem::Dependency
|
110
102
|
name: bundler
|
111
103
|
requirement: !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
112
105
|
requirements:
|
113
106
|
- - ~>
|
114
107
|
- !ruby/object:Gem::Version
|
@@ -116,6 +109,7 @@ dependencies:
|
|
116
109
|
type: :development
|
117
110
|
prerelease: false
|
118
111
|
version_requirements: !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
119
113
|
requirements:
|
120
114
|
- - ~>
|
121
115
|
- !ruby/object:Gem::Version
|
@@ -123,6 +117,7 @@ dependencies:
|
|
123
117
|
- !ruby/object:Gem::Dependency
|
124
118
|
name: spork
|
125
119
|
requirement: !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
126
121
|
requirements:
|
127
122
|
- - ! '>='
|
128
123
|
- !ruby/object:Gem::Version
|
@@ -130,6 +125,7 @@ dependencies:
|
|
130
125
|
type: :development
|
131
126
|
prerelease: false
|
132
127
|
version_requirements: !ruby/object:Gem::Requirement
|
128
|
+
none: false
|
133
129
|
requirements:
|
134
130
|
- - ! '>='
|
135
131
|
- !ruby/object:Gem::Version
|
@@ -137,6 +133,7 @@ dependencies:
|
|
137
133
|
- !ruby/object:Gem::Dependency
|
138
134
|
name: rspec
|
139
135
|
requirement: !ruby/object:Gem::Requirement
|
136
|
+
none: false
|
140
137
|
requirements:
|
141
138
|
- - ! '>='
|
142
139
|
- !ruby/object:Gem::Version
|
@@ -144,6 +141,7 @@ dependencies:
|
|
144
141
|
type: :development
|
145
142
|
prerelease: false
|
146
143
|
version_requirements: !ruby/object:Gem::Requirement
|
144
|
+
none: false
|
147
145
|
requirements:
|
148
146
|
- - ! '>='
|
149
147
|
- !ruby/object:Gem::Version
|
@@ -151,6 +149,7 @@ dependencies:
|
|
151
149
|
- !ruby/object:Gem::Dependency
|
152
150
|
name: thor
|
153
151
|
requirement: !ruby/object:Gem::Requirement
|
152
|
+
none: false
|
154
153
|
requirements:
|
155
154
|
- - ! '>='
|
156
155
|
- !ruby/object:Gem::Version
|
@@ -158,6 +157,7 @@ dependencies:
|
|
158
157
|
type: :development
|
159
158
|
prerelease: false
|
160
159
|
version_requirements: !ruby/object:Gem::Requirement
|
160
|
+
none: false
|
161
161
|
requirements:
|
162
162
|
- - ! '>='
|
163
163
|
- !ruby/object:Gem::Version
|
@@ -165,6 +165,7 @@ dependencies:
|
|
165
165
|
description: A Vagrant plugin to add Berkshelf integration to the Chef provisioners
|
166
166
|
email:
|
167
167
|
- reset@riotgames.com
|
168
|
+
- michael.ivey@riotgames.com
|
168
169
|
executables: []
|
169
170
|
extensions: []
|
170
171
|
extra_rdoc_files: []
|
@@ -201,26 +202,30 @@ files:
|
|
201
202
|
homepage: http://berkshelf.com
|
202
203
|
licenses:
|
203
204
|
- Apache 2.0
|
204
|
-
metadata: {}
|
205
205
|
post_install_message:
|
206
206
|
rdoc_options: []
|
207
207
|
require_paths:
|
208
208
|
- lib
|
209
209
|
required_ruby_version: !ruby/object:Gem::Requirement
|
210
|
+
none: false
|
210
211
|
requirements:
|
211
212
|
- - ! '>='
|
212
213
|
- !ruby/object:Gem::Version
|
213
214
|
version: 1.9.1
|
214
215
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
216
|
+
none: false
|
215
217
|
requirements:
|
216
218
|
- - ! '>='
|
217
219
|
- !ruby/object:Gem::Version
|
218
220
|
version: '0'
|
221
|
+
segments:
|
222
|
+
- 0
|
223
|
+
hash: -2561841672745040153
|
219
224
|
requirements: []
|
220
225
|
rubyforge_project:
|
221
|
-
rubygems_version:
|
226
|
+
rubygems_version: 1.8.23
|
222
227
|
signing_key:
|
223
|
-
specification_version:
|
228
|
+
specification_version: 3
|
224
229
|
summary: A Vagrant plugin to add Berkshelf integration to the Chef provisioners
|
225
230
|
test_files:
|
226
231
|
- spec/spec_helper.rb
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
NzE0MzU1NWI1YjNlNTFiNGEwYjFlNGI4YzM3YTcyYWEyZmYzZTc1Yg==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
YjBhYTE3OTU0OTc2NzZiNzhkMjJlZjJjMGE4ZGRmNzNiMjhkZTM2OA==
|
7
|
-
!binary "U0hBNTEy":
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
ZjBlMzI2YTQzMDljZjhkOTNlMWU3YzY5ZWNlNzYyZTdjZTk3MDkxNzM0Njll
|
10
|
-
ODQzNzdmZjYyYjU2OGE2NjQ0ODgyZTA2NTljZTk1OTU5MzUwMDVjODkyYjc1
|
11
|
-
YjJlNjRkZDgyZjk0MDE3MGQ4ODY4ZmNkMzdiYzkwN2M1ZDBkMDg=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YTgxZmYwMGI3ZGM4NWNlYmE3OTkwMjc5OGZkYzZhN2Y0MmFhMmZmYTEzOWU2
|
14
|
-
YTlhOGUyNDEwODk4NDYzNjFlMGI5M2RiNjc4MjNlMmNhYTkzNjJlMmQwZDc1
|
15
|
-
ZmMzNWEzNGQxYWE3ZDJjYmMxNGVkZTQ4ZGZlMDdhNmM4MTJiODE=
|