Guest User

Untitled

a guest
Jun 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. ## Application
  2. set :application, "MYAPP"
  3. set :deploy_to, "/var/www/#{application}"
  4.  
  5.  
  6. ## Settings
  7. default_run_options[:pty] = true
  8. set :use_sudo, false
  9.  
  10.  
  11. ## Servers
  12. set :domain, "DEPLOYSERVER"
  13. server domain, :app, :web, :db, :primary => true
  14.  
  15.  
  16. ## Repository
  17. set :scm, :git
  18. set :repository, "git@GITSERVER:MYAPP.git"
  19. set :branch, "master"
  20. set :deploy_via, :remote_cache
  21.  
  22.  
  23. ## SSH
  24. set :user, "deploy"
  25. set :ssh_options, { :forward_agent => true }
  26.  
  27.  
  28. ## Passenger commands
  29. namespace :deploy do
  30. desc "Restarting #{application}..."
  31. task :restart, :roles => :app, :except => { :no_release => true } do
  32. run "touch #{release_path}/tmp/restart.txt"
  33. end
  34.  
  35. [:start, :stop].each do |t|
  36. desc "#{t} task is a no-op with passenger (mod_rails)"
  37. task t, :roles => :app do ; end
  38. end
  39. end
  40.  
  41. on :start do
  42. `ssh-add`
  43. end
  44.  
  45.  
  46. ## Update server config files
  47. task :update_config, :roles => [:app] do
  48. run "cp -Rf #{shared_path}/config/* #{release_path}/config/"
  49. end
  50.  
  51. after "deploy:update_code", :update_config
Add Comment
Please, Sign In to add comment