Skip to content

Instantly share code, notes, and snippets.

@reu
Created May 6, 2011 17:59
Show Gist options
  • Save reu/959444 to your computer and use it in GitHub Desktop.
Save reu/959444 to your computer and use it in GitHub Desktop.
Capistrano recipe for passenger standalone
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