yyuu-capistrano-chef-solo 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/capistrano-chef-solo/version.rb +1 -1
- data/lib/capistrano-chef-solo.rb +25 -16
- metadata +2 -2
data/lib/capistrano-chef-solo.rb
CHANGED
@@ -21,14 +21,24 @@ module Capistrano
|
|
21
21
|
|
22
22
|
desc("Run chef-solo.")
|
23
23
|
task(:default) {
|
24
|
-
#
|
25
|
-
set(:
|
26
|
-
set(:
|
24
|
+
# preserve original :user and :ssh_options
|
25
|
+
set(:chef_solo_original_user, user)
|
26
|
+
set(:chef_solo_original_ssh_options, ssh_options)
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
begin
|
29
|
+
# login as chef user if specified
|
30
|
+
set(:user, fetch(:chef_solo_user, user))
|
31
|
+
set(:ssh_options, fetch(:chef_solo_ssh_options, ssh_options))
|
32
|
+
|
33
|
+
transaction {
|
34
|
+
bootstrap
|
35
|
+
update
|
36
|
+
}
|
37
|
+
ensure
|
38
|
+
# restore original :user and :ssh_options
|
39
|
+
set(:user, chef_solo_original_user)
|
40
|
+
set(:ssh_options, chef_solo_original_ssh_options)
|
41
|
+
end
|
32
42
|
}
|
33
43
|
|
34
44
|
task(:bootstrap) {
|
@@ -101,16 +111,15 @@ module Capistrano
|
|
101
111
|
# special variable to set multiple cookbooks repositories.
|
102
112
|
# by default, it will build from :chef_solo_cookbooks_* variables.
|
103
113
|
_cset(:chef_solo_cookbooks) {
|
104
|
-
repository = fetch(:chef_solo_cookbooks_repository,
|
114
|
+
repository = fetch(:chef_solo_cookbooks_repository, nil)
|
115
|
+
repository = fetch(:chef_solo_cookbook_repository, nil) unless repository # for backward compatibility
|
105
116
|
name = File.basename(repository, File.extname(repository))
|
106
|
-
{
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
}
|
113
|
-
}
|
117
|
+
options = { :repository => repository, :cookbooks_exclude => chef_solo_cookbooks_exclude }
|
118
|
+
options[:revision] = fetch(:chef_solo_cookbooks_revision, nil)
|
119
|
+
options[:revision] = fetch(:chef_solo_cookbook_revision, nil) unless options[:revision] # for backward compatibility
|
120
|
+
options[:cookbooks] = fetch(:chef_solo_cookbooks_subdir, nil)
|
121
|
+
options[:cookbooks] = fetch(:chef_solo_cookbook_subdir, nil) unless options[:cookbooks] # for backward compatibility
|
122
|
+
{ name => options }
|
114
123
|
}
|
115
124
|
|
116
125
|
_cset(:chef_solo_repository_cache) { File.expand_path('./tmp/cookbooks-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.7
|
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-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|