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

Untitled

By: a guest on Apr 27th, 2012  |  syntax: None  |  size: 1.72 KB  |  hits: 13  |  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. Capistrano with PHP
  2. set :application, "testapp"
  3. set :repository,  "<url of git repo>"
  4. set :deploy_to, "var/www/html/testapp"
  5. set :document_root, "var/www/html/testapp/current"
  6.  
  7. set :scm, :git
  8. set :scm_username, "MyUserName"
  9. set :scm_password, "MyPassword"
  10. set :scm_checkout, "clone"
  11. # Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
  12.  
  13. set :user, "<server's user name>"
  14. set :password, "<server's password>"
  15. set :use_sudo, false
  16. set :ssh_options, {:forward_agent => true}
  17.  
  18. role :web, "<server's IP>"                          # Your HTTP server, Apache/etc
  19. role :app, "<server's IP>"                          # This may be the same as your `Web` server
  20. role :db,  "<server's IP>", primary => true # This is where Rails migrations will run
  21.  
  22. # If you are using Passenger mod_rails uncomment this:
  23. # if you're still using the script/reapear helper you will need
  24. # these http://github.com/rails/irs_process_scripts
  25.  
  26. # namespace :deploy do
  27. #   task :start {}
  28. #   task :stop {}
  29. #   task :restart, :roles => :app, :except => { :no_release => true } do
  30. #     run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  31. #   end
  32. # end
  33. namespace :deploy do
  34.     task :update do
  35.         transaction do
  36.             update_code
  37.             symlink
  38.         end
  39.     end
  40.  
  41.     task :finalize_update do
  42.         transaction do          
  43.         end
  44.     end
  45.  
  46.     task :symlink do
  47.         transaction do
  48.             run "ln -nfs #{current_release} #{deploy_to}/#{current_dir}"
  49.             run "ln -nfs #{deploy_to}/#{current_dir} #{document_root}"
  50.         end
  51.     end
  52.  
  53.     task :migrate do
  54.     end
  55.  
  56.     task :restart do
  57.     end
  58. end
  59.        
  60. role :db,  "<server's IP>", primary => true
  61.        
  62. role :db,  "<server's IP>", :primary => true