Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 22nd, 2011  |  syntax: Ruby  |  size: 1.50 KB  |  views: 144  |  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. # Set the base dir to the parent dir because by convention the deploy.rb file is always located in the same place
  2. BASEDIR = File.expand_path(File.join(File.dirname(__FILE__), ".."))
  3. # name of the application
  4. set :application, "app1"
  5.  
  6. # do not use version control
  7. set :scm, :none
  8.  
  9. # path to deploy to.
  10. set :deploy_to, "/var/www/#{application}"
  11.  
  12. # set to a custom rsync strategy that has been put in capistrano lib.
  13. set :deploy_via, :rsync_with_remote_cache
  14.  
  15. # set user to use with rsync
  16. set :user, "app1"
  17.  
  18. # The path to the local files which is to be deployed
  19. set :local_cache,  "#{BASEDIR}/current"
  20.  
  21. # Rsync options
  22. set :rsync_options, '-h -O -aiz --delete --delete-after --exclude=.svn --exclude=*.fla --exclude=assets/fla --delete-excluded'
  23.  
  24. # setting a defualt role and all the servers to deploy to
  25. role :app, "app-server"
  26.  
  27. # making sure that all the default rails-tasks are not activated
  28. namespace :deploy do
  29.         [:setup, :start, :stop, :restart, :finalize_update, :migrate, :migrations].each do |default_task|
  30.         task default_task do
  31.                 logger.trace "Doing nothing in task #{default_task}"
  32.   end
  33.     end
  34. end
  35.  
  36. # # Keep 5 old releases (affects deploy:cleanup)
  37. set :keep_releases, 5
  38.  
  39. # # No need to use sudo, the permissions should be correct.
  40. set :use_sudo, false
  41.  
  42. # Loading extra files in the same dir with the exception of this file.
  43. Dir[BASEDIR + '/config/*.rb'].each { |f|
  44.         if File.basename(f, ".rb") != "deploy"
  45.                 load(f)
  46.         end
  47. }