Here's the Capistrano code I've been using with mod_rails:
namespace :deploy do
desc "Restarting mod_rails with restart.txt"
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end
[:start, :stop].each do |t|
desc "#{t} task is a no-op with mod_rails"
task t, :roles => :app do ; end
end
end
I think that's all there is to it... as far as I can tell, start and stop don't make much sense in a mod_rails context. I suppose you could use them to disable the app altogether somehow, although that kind of relates to this issue about maintenance.html.
Credit for the restart task goes to Jim Neath; the change I made was just to put it in the deploy namespace. Works either way, though.
Right on. Good stuff. I can't wait to reconfigure all my Dreamhost FastCGI sites to mod_rails. And this task gives me the goods for restarting.
Thanks!
Posted by: Tyler Bird | May 20, 2008 at 10:51 AM
Thanks so much for this. I now have a very clean deployment setup with Passenger.
Posted by: Collin VanDyck | May 24, 2008 at 01:53 PM
Nice! The second task is key (or was for me anyways) b/c :start and :stop will fail otherwise. Thanks!
Posted by: Luis | October 24, 2008 at 07:39 PM