capistrano-simple-unicorn 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b64ae6673a801efdb0c2fee3aa06ad515367ac26
|
4
|
+
data.tar.gz: 9b01051e95a1716b79477b34eb244444d1f1e265
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89116c1128e906762ee4c222d1fd8716a7dfcadc454e681e83c1f3c61564c80ae9d52aeeeb33abcaad46ee7b848059b0ef52d7083cc12695deddd2212d4c9a4a
|
7
|
+
data.tar.gz: a72e9cbddf1ebfccf7c1e4935bbee3db5cfa5d6521e1360ffcdee70472381df660adab1d4a7ec6ccd4ec48274214fa1492a53aa9899057eb2bc8f52a8e7aeb8a
|
Binary file
|
Binary file
|
@@ -23,63 +23,99 @@ namespace :load do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
namespace :unicorn do
|
26
|
-
desc
|
26
|
+
desc "Start Unicorn"
|
27
27
|
task :start do
|
28
28
|
on roles(fetch(:unicorn_roles)) do
|
29
29
|
within current_path do
|
30
|
-
if test("[ -e #{fetch(:
|
31
|
-
info
|
30
|
+
if test("[ -e #{fetch(:unicorn_pid_path)} ] && kill -0 #{pid}")
|
31
|
+
info "unicorn is running..."
|
32
32
|
else
|
33
33
|
with rails_env: fetch(:rails_env) do
|
34
|
-
execute :bundle,
|
34
|
+
execute :bundle, "exec unicorn", "-c", fetch(:unicorn_config_path), "-E", fetch(:unicorn_env), "-D", fetch(:unicorn_options)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
desc
|
41
|
+
desc "Stop Unicorn (QUIT)"
|
42
42
|
task :stop do
|
43
43
|
on roles(fetch(:unicorn_roles)) do
|
44
44
|
within current_path do
|
45
45
|
if test("[ -e #{fetch(:unicorn_pid_path)} ]")
|
46
46
|
if test("kill -0 #{pid}")
|
47
|
-
info
|
48
|
-
execute :kill,
|
47
|
+
info "stopping unicorn..."
|
48
|
+
execute :kill, "-s QUIT", pid
|
49
49
|
else
|
50
|
-
info
|
50
|
+
info "cleaning up dead unicorn pid..."
|
51
51
|
execute :rm, fetch(:unicorn_pid_path)
|
52
52
|
end
|
53
53
|
else
|
54
|
-
info
|
54
|
+
info "unicorn is not running..."
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
desc
|
60
|
+
desc "Reload Unicorn (HUP); use this when preload_app: false"
|
61
|
+
task :reload do
|
62
|
+
invoke "unicorn:start"
|
63
|
+
on roles(fetch(:unicorn_roles)) do
|
64
|
+
within current_path do
|
65
|
+
info "reloading..."
|
66
|
+
execute :kill, "-s HUP", pid
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
desc "Restart Unicorn (USR2); use this when preload_app: true"
|
61
72
|
task :restart do
|
62
|
-
invoke
|
73
|
+
invoke "unicorn:start"
|
63
74
|
on roles(fetch(:unicorn_roles)) do
|
64
75
|
within current_path do
|
65
|
-
info
|
66
|
-
execute :kill,
|
76
|
+
info "unicorn restarting..."
|
77
|
+
execute :kill, "-s USR2", pid
|
67
78
|
end
|
68
79
|
end
|
69
80
|
end
|
70
81
|
|
71
|
-
desc
|
82
|
+
desc "Duplicate Unicorn; alias of unicorn:restart"
|
83
|
+
task :duplicate do
|
84
|
+
invoke "unicorn:restart"
|
85
|
+
end
|
86
|
+
|
87
|
+
desc "Legacy Restart (USR2 + QUIT); use this when preload_app: true and oldbin pid needs cleanup"
|
72
88
|
task :legacy_restart do
|
73
|
-
invoke
|
89
|
+
invoke "unicorn:restart"
|
74
90
|
on roles(fetch(:unicorn_roles)) do
|
75
91
|
within current_path do
|
76
92
|
execute :sleep, fetch(:unicorn_restart_sleep_time)
|
77
93
|
if test("[ -e #{fetch(:unicorn_pid_path)}.oldbin ]")
|
78
|
-
execute :kill,
|
94
|
+
execute :kill, "-s QUIT", pid_oldbin
|
79
95
|
end
|
80
96
|
end
|
81
97
|
end
|
82
98
|
end
|
99
|
+
|
100
|
+
desc "Add a worker (TTIN)"
|
101
|
+
task :add_worker do
|
102
|
+
on roles(fetch(:unicorn_roles)) do
|
103
|
+
within current_path do
|
104
|
+
info "adding worker"
|
105
|
+
execute :kill, "-s TTIN", pid
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
desc "Remove a worker (TTOU)"
|
111
|
+
task :remove_worker do
|
112
|
+
on roles(fetch(:unicorn_roles)) do
|
113
|
+
within current_path do
|
114
|
+
info "removing worker"
|
115
|
+
execute :kill, "-s TTOU", pid
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
83
119
|
end
|
84
120
|
|
85
121
|
def pid
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-simple-unicorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- truongkma
|
@@ -66,6 +66,8 @@ files:
|
|
66
66
|
- Gemfile
|
67
67
|
- README.md
|
68
68
|
- Rakefile
|
69
|
+
- capistrano-simple-unicorn-1.1.0.gem
|
70
|
+
- capistrano-simple-unicorn-1.1.1.gem
|
69
71
|
- capistrano-simple-unicorn.gemspec
|
70
72
|
- lib/capistrano-simple-unicorn.rb
|
71
73
|
- lib/capistrano/simple_unicorn.rb
|