capistrano-upstart 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/capistrano-upstart/version.rb +1 -1
- data/lib/capistrano-upstart.rb +5 -3
- data/lib/templates/upstart.conf.erb +11 -21
- metadata +2 -2
data/lib/capistrano-upstart.rb
CHANGED
@@ -43,7 +43,9 @@ module Capistrano
|
|
43
43
|
_cset(:upstart_start_on, { :runlevel => "[2345]" })
|
44
44
|
_cset(:upstart_stop_on, { :runlevel => "[016]" })
|
45
45
|
_cset(:upstart_env, {})
|
46
|
-
_cset(:upstart_export
|
46
|
+
_cset(:upstart_export) {
|
47
|
+
upstart_env.keys
|
48
|
+
}
|
47
49
|
_cset(:upstart_script) {
|
48
50
|
abort("You must specify either :upstart_exec or :upstart_script.")
|
49
51
|
}
|
@@ -52,10 +54,10 @@ module Capistrano
|
|
52
54
|
_cset(:upstart_console, 'none')
|
53
55
|
_cset(:upstart_respawn, true)
|
54
56
|
_cset(:upstart_options) {{
|
55
|
-
"author" => fetch(:upstart_author, '').to_s.dump,
|
57
|
+
"author" => fetch(:upstart_author, 'unknown').to_s.dump,
|
56
58
|
"chdir" => upstart_chdir,
|
57
59
|
"console" => upstart_console,
|
58
|
-
"description" => fetch(:upstart_description,
|
60
|
+
"description" => fetch(:upstart_description, application).to_s.dump,
|
59
61
|
"respawn" => upstart_respawn,
|
60
62
|
}}
|
61
63
|
|
@@ -1,61 +1,51 @@
|
|
1
1
|
## start on
|
2
|
-
|
3
|
-
start on <%= key %> <%= val %>
|
4
|
-
<% end %>
|
2
|
+
<%= upstart_start_on.map { |key, val| "start on #{key} #{val}" }.join("\n") %>
|
5
3
|
|
6
4
|
## stop on
|
7
|
-
|
8
|
-
stop on <%= key %> <%= val %>
|
9
|
-
<% end %>
|
5
|
+
<%= upstart_stop_on.map { |key, val| "stop on #{key} #{val}" }.join("\n") %>
|
10
6
|
|
11
7
|
## env
|
12
|
-
|
13
|
-
env <%= "#{key}=#{val.to_s.dump}" %>
|
14
|
-
<% end %>
|
8
|
+
<%= upstart_env.map { |key, val| "env #{key}=#{val.to_s.dump}" }.join("\n") %>
|
15
9
|
|
16
10
|
## export
|
17
|
-
|
18
|
-
export <%= key %>
|
19
|
-
<% end %>
|
11
|
+
<%= upstart_export.map { |key| "export #{key}" }.join("\n") %>
|
20
12
|
|
21
13
|
## misc options
|
22
|
-
|
23
|
-
<%= val == true ? key : "#{key} #{val}" %>
|
24
|
-
<% end %>
|
14
|
+
<%= upstart_options.map { |key, val| val == true ? key : "#{key} #{val}" }.join("\n") %>
|
25
15
|
|
26
16
|
## pre-start
|
27
17
|
<% if fetch(:upstart_pre_start_script, nil) %>
|
28
18
|
pre-start script
|
29
|
-
<%= upstart_pre_start_script %>
|
19
|
+
<%= upstart_pre_start_script.chomp %>
|
30
20
|
end script
|
31
21
|
<% end %>
|
32
22
|
|
33
23
|
## script
|
34
24
|
<% if fetch(:upstart_exec, nil) %>
|
35
|
-
exec <%= upstart_exec %>
|
25
|
+
exec <%= upstart_exec.chomp %>
|
36
26
|
<% else %>
|
37
27
|
script
|
38
|
-
<%= upstart_script %>
|
28
|
+
<%= upstart_script.chomp %>
|
39
29
|
end script
|
40
30
|
<% end %>
|
41
31
|
|
42
32
|
## post-start
|
43
33
|
<% if fetch(:upstart_post_start_script, nil) %>
|
44
34
|
post-start script
|
45
|
-
<%= upstart_post_start_script %>
|
35
|
+
<%= upstart_post_start_script.chomp %>
|
46
36
|
end script
|
47
37
|
<% end %>
|
48
38
|
|
49
39
|
## pre-stop
|
50
40
|
<% if fetch(:upstart_pre_stop_script, nil) %>
|
51
41
|
pre-stop script
|
52
|
-
<%= upstart_pre_stop_script %>
|
42
|
+
<%= upstart_pre_stop_script.chomp %>
|
53
43
|
end script
|
54
44
|
<% end %>
|
55
45
|
|
56
46
|
## post-stop
|
57
47
|
<% if fetch(:upstart_post_stop_script, nil) %>
|
58
48
|
post-stop script
|
59
|
-
<%= upstart_post_stop_script %>
|
49
|
+
<%= upstart_post_stop_script.chomp %>
|
60
50
|
end script
|
61
51
|
<% end %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-upstart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
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-09-
|
12
|
+
date: 2012-09-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|