/ Published in: Rails
I normally paste this into config/mongrel.rb, then add "require 'mongrel'" in my config/deploy.rb
Once that's done, you'll be able to start, stop, and restart your mongrels like so:
`cap deploy:mongrel:start/stop/restart`
Once that's done, you'll be able to start, stop, and restart your mongrels like so:
`cap deploy:mongrel:start/stop/restart`
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
namespace :deploy do namespace :mongrel do [ :stop, :start, :restart ].each do |t| desc "#{t.to_s.capitalize} the mongrel appserver" task t, :roles => :app do #invoke_command checks the use_sudo variable to determine how to run the mongrel_rails command invoke_command "mongrel_rails cluster::#{t.to_s} -C #{mongrel_conf}", :via => run_method end end end desc "Custom restart task for mongrel cluster" task :restart, :roles => :app, :except => { :no_release => true } do deploy.mongrel.restart end desc "Custom start task for mongrel cluster" task :start, :roles => :app do deploy.mongrel.start end desc "Custom stop task for mongrel cluster" task :stop, :roles => :app do deploy.mongrel.stop end end