-
-
Save Kroid/2dcffa90759d56e3ad87 to your computer and use it in GitHub Desktop.
Revisions
-
trushkevich revised this gist
May 20, 2014 . 1 changed file with 21 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,33 @@ set :private_pub_pid, -> { "#{current_path}/tmp/pids/private_pub.pid" } namespace :private_pub do desc "Start private_pub server" task :start do on roles(:app) do within release_path do with rails_env: fetch(:stage) do execute :bundle, "exec thin -C config/private_pub/thin_#{fetch(:stage)}.yml -d -P #{fetch(:private_pub_pid)} start" end end end end desc "Stop private_pub server" task :stop do on roles(:app) do within release_path do execute "if [ -f #{fetch(:private_pub_pid)} ] && [ -e /proc/$(cat #{fetch(:private_pub_pid)}) ]; then kill -9 `cat #{fetch(:private_pub_pid)}`; fi" end end end desc "Restart private_pub server" task :restart do on roles(:app) do invoke 'private_pub:stop' invoke 'private_pub:start' end end end after 'deploy:restart', 'private_pub:restart' -
alec-c4 revised this gist
Aug 7, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,12 @@ namespace :private_pub do desc "Start private_pub server" task :start do run "cd #{current_path};RAILS_ENV=production bundle exec rackup private_pub.ru -s thin -E production -D -P tmp/pids/private_pub.pid" end desc "Stop private_pub server" task :stop do run "cd #{current_path};if [ -f tmp/pids/private_pub.pid ] && [ -e /proc/$(cat tmp/pids/private_pub.pid) ]; then kill -9 `cat tmp/pids/private_pub.pid`; fi" end desc "Restart private_pub server" -
alec-c4 renamed this gist
Jul 29, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
alec-c4 created this gist
Jul 29, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ namespace :private_pub do desc "Start private_pub server" task :start do run "cd #{current_path};bundle exec rackup private_pub.ru -s thin -E production -D -P tmp/pids/private-pub.pid" end desc "Stop private_pub server" task :stop do run "cd #{current_path};kill -9 `cat tmp/pids/private-pub.pid`; rm tmp/pids/private-pub.pid" end desc "Restart private_pub server" task :restart do find_and_execute_task("private_pub:stop") find_and_execute_task("private_pub:start") end end