nomagic_capistrano_recipes 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
|