Skip to content

Instantly share code, notes, and snippets.

@rainchen
Last active December 18, 2015 16:29
Show Gist options
  • Save rainchen/5811666 to your computer and use it in GitHub Desktop.
Save rainchen/5811666 to your computer and use it in GitHub Desktop.
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