Guest User

Untitled

a guest
Jul 12th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. set :application, "alice"
  2.  
  3. set :deploy_to, "~/#{application}"
  4.  
  5. set :scm, :git
  6. set :repository, "git@github.com:grays/accounting.app.git"
  7. set :git_enable_submodules, true
  8. set :deploy_via, :remote_cache
  9.  
  10. role :app, "alice"
  11. role :web, "alice"
  12. role :db, "alice", :primary => true
  13.  
  14. ssh_options[:username] = "deploy"
  15. ssh_options[:forward_agent] = true
  16.  
  17. set :run_method, :run
  18.  
  19. namespace :deploy do
  20. task :custom_symlinks do
  21. run "ln -nfs #{shared_path}/system/database.yml #{release_path}/config/database.yml"
  22. end
  23.  
  24. desc "Restart Passenger"
  25. task :restart, :roles => :app, :except => { :no_release => true } do
  26. run "touch #{current_path}/tmp/restart.txt"
  27. end
  28.  
  29. [:start, :stop].each do |t|
  30. desc "#{t} task is a no-op with Passenger"
  31. task t, :roles => :app do ; end
  32. end
  33.  
  34. desc "Update the crontab file"
  35. task :update_crontab, :roles => :db do
  36. run "cd #{release_path} && whenever --update-crontab #{application}"
  37. end
  38. end
  39.  
  40. after "deploy:symlink", "deploy:custom_symlinks", "deploy:update_crontab"
  41. after "deploy", "deploy:cleanup"
Add Comment
Please, Sign In to add comment