Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 25th, 2012  |  syntax: None  |  size: 2.08 KB  |  hits: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. default_run_options[:pty] = true
  2. set :scm,         :git
  3. set :scm_verbose, true
  4.  
  5. # Multistage settings
  6. # :deploy_to is set in deploy/#{stage}.rb
  7. set :stages, %w(staging production)
  8. set :default_stage, "staging"
  9. set(:stage_path) { "#{latest_release}/config/stages/#{stage}" }
  10. require 'capistrano/ext/multistage'
  11.  
  12. set :user,   'deployer'
  13. set :runner, 'deployer'
  14. set :application, "alabama-beach-pool"
  15. set :repository,  "git@github.com:isotope11/alabama-beach-pool.git"
  16.  
  17. set :repository_cache, "cached-copy"
  18. set :deploy_via, :remote_cache
  19.  
  20. # If you aren't deploying to /u/apps/#{application} on the target
  21. # servers (which is the default), you can specify the actual location
  22. # via the :deploy_to variable:
  23. set :deploy_to, "/home/deploy/#{application}"
  24.  
  25. role :app, "50.57.148.105"
  26. role :web, "50.57.148.105"
  27. role :db,  "50.57.148.105", :primary => true
  28.  
  29. task :sym_public_files do
  30.   %w{ address_files uploads file_section_file residential_insurance_application nacha_batch}.each do |dir|
  31.     run "ln -s #{deploy_to}/shared/#{dir} #{deploy_to}/current/public/#{dir}"
  32.   end
  33. end
  34.  
  35. desc "Starts Memcache"
  36. task :start_memcache do
  37.   run "cd #{latest_release} && RAILS_ENV=production rake memcache:start"
  38. end
  39.  
  40. namespace :deploy do
  41.   after 'deploy:setup',   'alabama-beach-pool:content:create_dirs'
  42.   after 'deploy:restart', 'sym_public_files'
  43.   #before 'deploy:start', 'start_memcache'
  44.   #before 'deploy:restart', 'start_memcache'
  45.  
  46.   #after 'deploy:update_code', 'sass'
  47. end
  48.  
  49. desc "Update Sass stylesheets"
  50. task :sass do
  51.   run "cd #{latest_release} && ruby -rconfig/environment -e 'Sass::Plugin.update_stylesheets'"
  52. end
  53.  
  54. namespace :deploy do
  55.   desc "Restarting mod_rails with restart.txt"
  56.   task :restart, :roles => :app, :except => { :no_release => true } do
  57.     run "touch #{current_path}/tmp/restart.txt"
  58.   end
  59.  
  60.   [:start, :stop].each do |t|
  61.     desc "#{t} task is a no-op with mod_rails"
  62.     task t, :roles => :app do ; end
  63.   end
  64. end
  65. #Dir[File.join(File.dirname(__FILE__), '..', 'vendor', 'gems', 'hoptoad_notifier-*')].each do |vendored_notifier|
  66. #  $: << File.join(vendored_notifier, 'lib')
  67. #end
  68. #
  69. #require 'hoptoad_notifier/capistrano'