Rails-GitHub-Dreamhost-Capistrano deploy script


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ############################
  2. # Based on the original DreamHost deploy.rb recipe
  3. #
  4. #
  5. # GitHub settings #######################################################################################
  6. default_run_options[:pty] = true
  7. set :repository, "[email protected]:username/your-repo.git" #GitHub clone URL
  8. set :scm, "git"
  9. set :scm_passphrase, "pa$$w0rd" #This is the passphrase for the ssh key on the server deployed to
  10. set :branch, "master"
  11. set :scm_verbose, true
  12. #########################################################################################################
  13. set :user, 'username' #Dreamhost username
  14. set :domain, 'server.dreamhost.com' # Dreamhost servername where your account is located
  15. set :project, 'projectname' # Your application as its called in the repository
  16. set :application, 'sub.domain.com' # Your app's location (domain or sub-domain name as setup in panel)
  17. set :applicationdir, "/home/#{user}/#{application}" # The standard Dreamhost setup
  18.  
  19. # Don't change this stuff, but you may want to set shared files at the end of the file ##################
  20. # deploy config
  21. set :deploy_to, applicationdir
  22. set :deploy_via, :remote_cache
  23.  
  24. # roles (servers)
  25. role :app, domain
  26. role :web, domain
  27. role :db, domain, :primary => true
  28.  
  29. namespace :deploy do
  30. [:start, :stop, :restart, :finalize_update, :migrate, :migrations, :cold].each do |t|
  31. desc "#{t} task is a no-op with mod_rails"
  32. task t, :roles => :app do ; end
  33. end
  34. end
  35.  
  36. # additional settings
  37. default_run_options[:pty] = true # Forgo errors when deploying from windows
  38. #ssh_options[:keys] = %w(/Path/To/id_rsa) # If you are using ssh_keys
  39. #set :chmod755, "app config db lib public vendor script script/* public/disp*"
  40. set :use_sudo, false
  41.  
  42. #########################################################################################################
  43.  
  44. #for use with shared files (e.g. config files)
  45. after "deploy:update_code" do
  46. run "ln -s #{shared_path}/database.yml #{release_path}/config"
  47. run "ln -s #{shared_path}/environment.rb #{release_path}/config"
  48. end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.