Created
May 6, 2011 17:59
-
-
Save reu/959444 to your computer and use it in GitHub Desktop.
Capistrano recipe for passenger standalone
This file contains 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 characters
set :rails_env, "production" | |
set :passenger_port, 9292 | |
set :passenger_cmd, "#{bundle_cmd} exec passenger" | |
namespace :deploy do | |
task :start, :roles => :app, :except => { :no_release => true } do | |
run "cd #{current_path} && #{passenger_cmd} start -e #{rails_env} -p #{passenger_port} -d" | |
end | |
task :stop, :roles => :app, :except => { :no_release => true } do | |
run "cd #{current_path} && #{passenger_cmd} stop -p #{passenger_port}" | |
end | |
task :restart, :roles => :app, :except => { :no_release => true } do | |
run <<-CMD | |
if [[ -f #{current_path}/tmp/pids/passenger.#{passenger_port}.pid ]]; | |
then | |
cd #{current_path} && #{passenger_cmd} stop -p #{passenger_port}; | |
fi | |
CMD | |
run "cd #{current_path} && #{passenger_cmd} start -e #{rails_env} -p #{passenger_port} -d" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment