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
@@ -1,3 +1,3 @@
1
1
  module NomagicCapistranoRecipes
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nomagic_capistrano_recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: