berkshelf 0.6.0.beta1 → 0.6.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- data/berkshelf.gemspec +1 -1
- data/lib/berkshelf/berksfile.rb +3 -1
- data/lib/berkshelf/vagrant.rb +5 -5
- data/lib/berkshelf/vagrant/action/clean.rb +1 -1
- data/lib/berkshelf/vagrant/action/install.rb +3 -3
- data/lib/berkshelf/vagrant/action/upload.rb +6 -6
- data/lib/berkshelf/version.rb +1 -1
- metadata +4 -4
data/berkshelf.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
|
19
19
|
s.add_runtime_dependency 'ridley', '>= 0.0.5'
|
20
20
|
s.add_runtime_dependency 'solve', '>= 0.3.0'
|
21
|
-
s.add_runtime_dependency 'chef', '~> 10.12
|
21
|
+
s.add_runtime_dependency 'chef', '~> 10.12'
|
22
22
|
s.add_runtime_dependency 'minitar'
|
23
23
|
s.add_runtime_dependency 'thor', '~> 0.16.0'
|
24
24
|
s.add_runtime_dependency 'vagrant', '~> 1.0.5'
|
data/lib/berkshelf/berksfile.rb
CHANGED
@@ -32,7 +32,9 @@ module Berkshelf
|
|
32
32
|
|
33
33
|
scratch = Berkshelf.mktmpdir
|
34
34
|
cookbooks.each do |cb|
|
35
|
-
|
35
|
+
dest = File.join(scratch, cb.cookbook_name, "/")
|
36
|
+
FileUtils.mkdir_p(dest)
|
37
|
+
FileUtils.cp_r(Dir.glob(File.join(cb.path, "*")), dest)
|
36
38
|
end
|
37
39
|
|
38
40
|
FileUtils.remove_dir(path, force: true)
|
data/lib/berkshelf/vagrant.rb
CHANGED
@@ -18,12 +18,12 @@ module Berkshelf
|
|
18
18
|
|
19
19
|
class << self
|
20
20
|
# @param [Vagrant::Action::Environment] env
|
21
|
+
#
|
22
|
+
# @return [String, nil]
|
21
23
|
def shelf_for(env)
|
22
|
-
|
23
|
-
return nil
|
24
|
-
end
|
24
|
+
return nil if env[:vm].uuid.nil?
|
25
25
|
|
26
|
-
File.join(Berkshelf.berkshelf_path, "vagrant", env[:
|
26
|
+
File.join(Berkshelf.berkshelf_path, "vagrant", env[:vm].uuid)
|
27
27
|
end
|
28
28
|
|
29
29
|
# @param [Symbol] shortcut
|
@@ -64,7 +64,7 @@ module Berkshelf
|
|
64
64
|
::Vagrant.actions[action].insert(::Vagrant::Action::VM::Provision, Berkshelf::Vagrant::Middleware.upload)
|
65
65
|
end
|
66
66
|
|
67
|
-
::Vagrant.actions[:destroy].insert(::Vagrant::Action::VM::
|
67
|
+
::Vagrant.actions[:destroy].insert(::Vagrant::Action::VM::ProvisionerCleanup, Berkshelf::Vagrant::Middleware.clean)
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
@@ -11,7 +11,7 @@ module Berkshelf
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def call(env)
|
14
|
-
if Berkshelf::Vagrant.chef_solo?(env[:
|
14
|
+
if Berkshelf::Vagrant.chef_solo?(env[:vm].config) && self.shelf
|
15
15
|
Berkshelf.formatter.msg "cleaning Vagrant's shelf"
|
16
16
|
FileUtils.remove_dir(self.shelf, fore: true)
|
17
17
|
end
|
@@ -11,14 +11,14 @@ module Berkshelf
|
|
11
11
|
def initialize(app, env)
|
12
12
|
@app = app
|
13
13
|
@shelf = Berkshelf::Vagrant.shelf_for(env)
|
14
|
-
@config = env[:
|
14
|
+
@config = env[:vm].config.berkshelf
|
15
15
|
Berkshelf.config_path = @config.config_path
|
16
16
|
Berkshelf.load_config
|
17
17
|
@berksfile = Berksfile.from_file(@config.berksfile_path)
|
18
18
|
end
|
19
19
|
|
20
20
|
def call(env)
|
21
|
-
if Berkshelf::Vagrant.chef_solo?(env[:
|
21
|
+
if Berkshelf::Vagrant.chef_solo?(env[:vm].config)
|
22
22
|
configure_cookbooks_path(env)
|
23
23
|
install(env)
|
24
24
|
end
|
@@ -37,7 +37,7 @@ module Berkshelf
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def configure_cookbooks_path(env)
|
40
|
-
Berkshelf::Vagrant.provisioners(:chef_solo, env[:
|
40
|
+
Berkshelf::Vagrant.provisioners(:chef_solo, env[:vm].config).each do |provisioner|
|
41
41
|
provisioner.config.cookbooks_path.unshift(self.shelf)
|
42
42
|
end
|
43
43
|
end
|
@@ -10,14 +10,14 @@ module Berkshelf
|
|
10
10
|
|
11
11
|
def initialize(app, env)
|
12
12
|
@app = app
|
13
|
-
@node_name = env[:
|
14
|
-
@client_key = env[:
|
15
|
-
@ssl_verify = env[:
|
16
|
-
@berksfile = Berksfile.from_file(env[:
|
13
|
+
@node_name = env[:vm].config.berkshelf.node_name
|
14
|
+
@client_key = env[:vm].config.berkshelf.client_key
|
15
|
+
@ssl_verify = env[:vm].config.berkshelf.ssl_verify
|
16
|
+
@berksfile = Berksfile.from_file(env[:vm].config.berkshelf.berksfile_path)
|
17
17
|
end
|
18
18
|
|
19
19
|
def call(env)
|
20
|
-
if Berkshelf::Vagrant.chef_client?(env[:
|
20
|
+
if Berkshelf::Vagrant.chef_client?(env[:vm].config)
|
21
21
|
upload(env)
|
22
22
|
end
|
23
23
|
|
@@ -27,7 +27,7 @@ module Berkshelf
|
|
27
27
|
private
|
28
28
|
|
29
29
|
def upload(env)
|
30
|
-
Berkshelf::Vagrant.provisioners(:chef_client, env[:
|
30
|
+
Berkshelf::Vagrant.provisioners(:chef_client, env[:vm].config).each do |provisioner|
|
31
31
|
Berkshelf.formatter.msg "uploading cookbooks to '#{provisioner.config.chef_server_url}'"
|
32
32
|
berksfile.upload(
|
33
33
|
server_url: provisioner.config.chef_server_url,
|
data/lib/berkshelf/version.rb
CHANGED
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: 0.6.0.
|
4
|
+
version: 0.6.0.beta2
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2012-09-
|
15
|
+
date: 2012-09-28 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: ridley
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
requirements:
|
54
54
|
- - ~>
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 10.12
|
56
|
+
version: '10.12'
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -61,7 +61,7 @@ dependencies:
|
|
61
61
|
requirements:
|
62
62
|
- - ~>
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: 10.12
|
64
|
+
version: '10.12'
|
65
65
|
- !ruby/object:Gem::Dependency
|
66
66
|
name: minitar
|
67
67
|
requirement: !ruby/object:Gem::Requirement
|