Mongrel Spinner and Restart tasks for Capistrano
h2. Spinner
desc <<-DESC Spinner is run by the default cold_deploy task. Instead of using script/spinner, we're just gonna rely on Mongrel to keep itself up. DESC task :spinner, :roles => :app do application_port = xxxx #get this from your friendly sysadmin run "mongrel_rails start -e production -p #{application_port} -d -c #{current_path}" end
h2. Restart
desc "Restart the web server" task :restart, :roles => :app do begin run "cd #{current_path} && mongrel_rails restart" rescue RuntimeError => e puts e puts "Probably not a big deal, so I'll just keep trucking..." end end
There's a more complete article on my blog.