yyuu-capistrano-chef-solo 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -0
- data/lib/capistrano-chef-solo.rb +11 -12
- data/lib/capistrano-chef-solo/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -29,6 +29,7 @@ To setup your servers with `chef-solo`, add following in you `config/deploy.rb`.
|
|
29
29
|
|
30
30
|
# in "config/deploy.rb"
|
31
31
|
require 'capistrano-chef-solo'
|
32
|
+
set(:chef_solo_version, "10.12.0")
|
32
33
|
set(:chef_solo_cookbooks_repository, "git@example.com:foo/bar.git")
|
33
34
|
|
34
35
|
And then, now you can start `chef-solo` via capistrano.
|
data/lib/capistrano-chef-solo.rb
CHANGED
@@ -15,7 +15,7 @@ module Capistrano
|
|
15
15
|
_cset(:chef_solo_home) {
|
16
16
|
capture('echo $HOME').strip
|
17
17
|
}
|
18
|
-
_cset(:chef_solo_version, '
|
18
|
+
_cset(:chef_solo_version, '10.16.2')
|
19
19
|
_cset(:chef_solo_path) { File.join(chef_solo_home, 'chef') }
|
20
20
|
_cset(:chef_solo_path_children, %w(bundle cache config cookbooks))
|
21
21
|
|
@@ -113,24 +113,23 @@ module Capistrano
|
|
113
113
|
}
|
114
114
|
}
|
115
115
|
|
116
|
-
_cset(:chef_solo_configuration, configuration)
|
117
116
|
_cset(:chef_solo_repository_cache) { File.expand_path('./tmp/cookbooks-cache') }
|
118
117
|
def bundle_cookbooks(filename, destination)
|
119
118
|
dirs = [ File.dirname(filename), destination ].uniq
|
120
119
|
run_locally("mkdir -p #{dirs.join(' ')}")
|
121
120
|
chef_solo_cookbooks.each do |name, options|
|
122
121
|
configuration = Capistrano::Configuration.new()
|
123
|
-
chef_solo_configuration.variables.merge(options).each { |key, val|
|
124
|
-
configuration.set(key, val)
|
125
|
-
}
|
126
122
|
# refreshing just :source, :revision and :real_revision is enough?
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
with_env("LC_ALL", "C") { run_locally(cmd) }
|
132
|
-
}
|
133
|
-
}
|
123
|
+
options = {
|
124
|
+
:source => proc { Capistrano::Deploy::SCM.new(configuration[:scm], configuration) },
|
125
|
+
:revision => proc { configuration[:source].head },
|
126
|
+
:real_revision => proc {
|
127
|
+
configuration[:source].local.query_revision(configuration[:revision]) { |cmd| with_env("LC_ALL", "C") { run_locally(cmd) } }
|
128
|
+
},
|
129
|
+
}.merge(options)
|
130
|
+
variables.merge(options).each do |key, val|
|
131
|
+
configuration.set(key, val)
|
132
|
+
end
|
134
133
|
repository_cache = File.join(chef_solo_repository_cache, name)
|
135
134
|
if File.exist?(repository_cache)
|
136
135
|
run_locally(configuration[:source].sync(configuration[:real_revision], repository_cache))
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yyuu-capistrano-chef-solo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|