From 064a28c9f5bc28e24dfdf00be93c63ca4dd12b16 Mon Sep 17 00:00:00 2001 From: El Matou Date: Thu, 21 Jul 2011 10:40:29 +0200 Subject: [PATCH] Support Passenger Standalone mode --- lib/cap_recipes/tasks/passenger/manage.rb | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lib/cap_recipes/tasks/passenger/manage.rb b/lib/cap_recipes/tasks/passenger/manage.rb index a2b0710..3cb3246 100644 --- a/lib/cap_recipes/tasks/passenger/manage.rb +++ b/lib/cap_recipes/tasks/passenger/manage.rb @@ -20,4 +20,35 @@ end end + + namespace :passenger do + + desc "Standalone mode for passenger" + namespace :standalone do + + desc "Starts the standalone passenger server" + task :start do + run "cd #{current_path} && passenger start -a 127.0.0.1 -p 3000 -d -e #{stage_or_production}" + end + + desc "Stops the standalone passenger server" + task :stop do + run "cd #{current_path} && passenger stop" + end + + desc "Restarts the standalone passenger server" + task :restart, :roles => :app, :except => { :no_release => true } do + run "cd #{current_path} && passenger stop" + run "cd #{current_path} && passenger start -a 127.0.0.1 -p 3000 -d -e #{stage_or_production}" + end + + end + + end + # =============================================================== + # Support for capistrano-ext + # =============================================================== + def stage_or_production + exists?(:stage) ? stage : "production" + end end