Skip to content

Instantly share code, notes, and snippets.

@rainchen
Last active Dec 18, 2015
Embed
What would you like to do?
private_pub capistrano tasks
namespace :private_pub do
desc "Start private_pub server"
task :start do
run "cd #{current_path};RAILS_ENV=#{rails_env} bundle exec rackup private_pub.ru -s thin -E #{rails_env} -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
stop
start
end
end
after 'deploy:restart', 'private_pub:restart'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment