Posted By

bcalloway on 07/14/08


Tagged

dreamhost capistrano deploy


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

fernyb
webstic


Dreamhost Capistrano deploy recipe


 / Published in: Ruby
 

This is a capistrano deploy recipe for use with hosting on Dreamhost, as per the Dreamhost support wiki

  1. ############################
  2. # Original DreamHost deploy.rb recipe
  3. #
  4. set :user, 'dhuser' # Your dreamhost account's username
  5. set :domain, 'servername.dreamhost.com' # Dreamhost servername where your account is located
  6. set :project, 'myapp_name_from_repository' # Your application as its called in the repository
  7. set :application, 'myapp.mydomain.com' # Your app's location (domain or sub-domain name as setup in panel)
  8. set :applicationdir, "/home/#{user}/#{application}" # The standard Dreamhost setup
  9.  
  10. ## version control config
  11. set :scm_username, 'YOUR_SVN_USERNAME'
  12. set :scm_password, 'YOUR_SVN_PASSWORD'
  13. set :repository, "http://svn.my_subversion_domain/#{project}/trunk/"
  14.  
  15. # deploy config
  16. set :deploy_to, applicationdir
  17. set :deploy_via, :export
  18.  
  19. # roles (servers)
  20. role :app, domain
  21. role :web, domain
  22. role :db, domain, :primary => true
  23.  
  24. namespace :deploy do
  25. [:start, :stop, :restart, :finalize_update, :migrate, :migrations, :cold].each do |t|
  26. desc "#{t} task is a no-op with mod_rails"
  27. task t, :roles => :app do ; end
  28. end
  29. end
  30.  
  31. # additional settings
  32. default_run_options[:pty] = true # Forgo errors when deploying from windows
  33. #ssh_options[:keys] = %w(/Path/To/id_rsa) # If you are using ssh_keys
  34. #set :chmod755, "app config db lib public vendor script script/* public/disp*"
  35. set :use_sudo, false
  36.  
  37. ############################
  38.  
  39. #for use with shared files (e.g. config files)
  40. after "deploy:update_code" do
  41. run "ln -s #{shared_path}/sharedfile.xml #{release_path}/path/to/shared-file/dir"
  42. end

Report this snippet  

You need to login to post a comment.