public
Last active

private_pub capistrano tasks

  • Download Gist
deploy.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
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"
task :restart do
find_and_execute_task("private_pub:stop")
find_and_execute_task("private_pub:start")
end
end

По-моему, вместо find_and_execute_task с именем таска можно писать просто

task :restart do
  stop
  start
end

Кир прав.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.