Sha256: 5ef96800b2926ef2762ea8bb78c3d7710aee3ced594fae7aebfecddccba329c9

Contents?: true

Size: 1.91 KB

Versions: 1

Compression:

Stored size: 1.91 KB

Contents

Capistrano.configuration(:must_exist).load do
  set :mongrel_servers, "2"
  set :mongrel_port, "8000"
  set :mongrel_address, "127.0.0.1"
  set :mongrel_environment, "production"
  set(:mongrel_config) { "#{deploy_to}/config/mongrel_cluster.yml" }
  
  desc <<-DESC
  Configure Mongrel processes on the app server. This uses the :use_sudo
  variable to determine whether to use sudo or not.
  DESC
  task :configure_mongrel_cluster, :roles => :app do
    send(run_method, "if [ ! -d #{File.dirname(mongrel_config)} ]; then mkdir -p #{File.dirname(mongrel_config)}; fi")
    send(run_method, "mongrel_rails cluster::configure -N #{mongrel_servers} -p #{mongrel_port} -e #{mongrel_environment} -a #{mongrel_address} -c #{current_path} -C #{mongrel_config}")
  end
  
  desc <<-DESC
  Start Mongrel processes on the app server. This uses the :use_sudo
  variable to determine whether to use sudo or not.
  DESC
  task :start_mongrel_cluster , :roles => :app do
    send(run_method, "mongrel_rails cluster::start -C #{mongrel_config}")
  end
  
  desc <<-DESC
  Restart the Mongrel processes on the app server. This uses the :use_sudo
  variable to determine whether to use sudo or not. 
  DESC
  task :restart_mongrel_cluster , :roles => :app do
    send(run_method, "mongrel_rails cluster::restart -C #{mongrel_config}")
  end
  
  desc <<-DESC
  Stop the Mongrel processes on the app server. This uses the :use_sudo
  variable to determine whether to use sudo or not.
  DESC
  task :stop_mongrel_cluster , :roles => :app do
    send(run_method, "mongrel_rails cluster::stop -C #{mongrel_config}")
  end
  
  desc <<-DESC
  Restart the Mongrel processes on the app server by calling restart_mongrel_cluster.
  DESC
  task :restart, :roles => :app do
    restart_mongrel_cluster
  end
  
  desc <<-DESC
  Start the Mongrel processes on the app server by calling start_mongrel_cluster.
  DESC
  task :spinner, :roles => :app do
    start_mongrel_cluster
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongrel_cluster-0.1.1 lib/mongrel_cluster/recipes.rb