nomagic_capistrano_recipes 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -145,5 +145,20 @@ module NomagicCapistranoRecipes
|
|
145
145
|
end
|
146
146
|
end
|
147
147
|
end
|
148
|
+
|
149
|
+
namespace :unicorn do
|
150
|
+
set(:unicorn_conf) { "#{deploy_to}/#{shared_dir}/config/unicorn.rb" }
|
151
|
+
set(:unicorn_pid) { "#{deploy_to}/#{shared_dir}/pids/unicorn.pid" }
|
152
|
+
|
153
|
+
task :restart do
|
154
|
+
run "if [ -f #{unicorn_pid} ] && [ -e /proc/$(cat #{unicorn_pid}) ]; then kill -USR2 `cat #{unicorn_pid}`; else cd #{deploy_to}/current && bundle exec unicorn -c #{unicorn_conf} -E #{rails_env} -D; fi"
|
155
|
+
end
|
156
|
+
task :start do
|
157
|
+
run "cd #{deploy_to}/current && bundle exec unicorn -c #{unicorn_conf} -E #{rails_env} -D"
|
158
|
+
end
|
159
|
+
task :stop do
|
160
|
+
run "if [ -f #{unicorn_pid} ] && [ -e /proc/$(cat #{unicorn_pid}) ]; then kill -QUIT `cat #{unicorn_pid}`; fi"
|
161
|
+
end
|
162
|
+
end
|
148
163
|
end
|
149
164
|
end
|