set :use_sudo, false ip_address = "192.168.13.131" set :application, "Intranet" role :web, ip_address role :app, ip_address role :db, ip_address, :primary => true set :user, "captain" set :password, "police73" set :repository, "http://svn.receptacular.org/#{application}/trunk" set :deploy_to, "/home/captain/apps/#{application}" =begin # TASKS TO MANAGE SINGLE MONGREL INSTANCE # Where to store Mongrel PID file mongrel_pid = "#{shared_path}/pids/mongrel.pid" # Port to run on port = 4000 desc "Override the spinner task with one which starts Mongrel" task :spinner, :roles => :app do run <<-CMD mongrel_rails start -e production -p #{port} -P #{mongrel_pid} -c #{current_path} -d CMD end desc "Alias for spinner" task :start do spinner end desc "Override the restart task with one which restarts Mongrel" task :restart, :roles => :app do run "mongrel_rails restart -P #{mongrel_pid}" end desc "Stop Mongrel" task :stop, :roles => :app do run "mongrel_rails stop -P #{mongrel_pid}" end =end # TASKS FOR MANAGING MONGREL CLUSTER # # Cluster config file location cluster_config = "#{shared_path}/system/intranet_cluster.yml" desc "Override the spinner task with one which starts Mongrel" task :spinner, :roles => :app do run <<-CMD sudo mongrel_rails cluster::start -C #{cluster_config} CMD end desc "Alias for spinner" task :start do spinner end desc "Override the restart task with one which restarts Mongrel" task :restart, :roles => :app do run "sudo mongrel_rails cluster::restart -C #{cluster_config}" end desc "Stop Mongrel" task :stop, :roles => :app do run "sudo mongrel_rails cluster::stop -C #{cluster_config}" end task :symlink_for_file_uploads, :roles => :app do run <<-CMD mkdir -p -m 775 #{shared_path}/system/files && rm -Rf #{release_path}/public/files && ln -s #{shared_path}/system/files #{release_path}/public/files CMD end desc "Make all custom scripts (in script directory) executable" task :make_scripts_executable, :roles => :app do run "chmod -R u+x #{release_path}/script" end task :after_update_code do symlink_for_file_uploads make_scripts_executable end