Guest User

Untitled

a guest
Mar 8th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. set :application, "[application name here]"
  2. set :repository, "."
  3. set :deploy_to, "[where you want the code to go]"
  4. set :scm, :git
  5. set :branch, "master"
  6. set :use_sudo, false
  7. set :deploy_via, :copy
  8. set :copy_cache, true
  9. set :copy_exclude, [".git", "materials"]
  10. set :www_user, "[name of the user the webserver runs as]"
  11.  
  12. role :app, "[servername]"
  13. role :web, "[servername]"
  14. role :db, "[servername]", :primary => true
  15.  
  16. namespace :deploy do
  17.  
  18. task :update do
  19. transaction do
  20. update_code
  21. symlink
  22. end
  23. end
  24.  
  25. task :finalize_update do
  26. transaction do
  27. run "chmod -R g+w #{releases_path}/#{release_name}"
  28. end
  29. end
  30.  
  31. task :symlink do
  32. transaction do
  33. run "ln -nfs #{current_release} #{deploy_to}/#{current_dir}"
  34. run "ln -nfs #{current_release}/config/apache.conf /usr/local/etc/apache22/sites/#{application}.conf"
  35. run "rm -rf #{current_release}/public/wp-content/uploads"
  36. run "ln -nfs #{shared_path}/uploads #{current_release}/public/wp-content/uploads"
  37. run "ln -nfs #{shared_path}/htaccess #{current_release}/public/.htaccess"
  38. end
  39. end
  40.  
  41. task :migrate do
  42. # nothing
  43. end
  44.  
  45. task :restart do
  46. # nothing
  47. end
  48.  
  49. task :setup_upload_dir do
  50. run "mkdir -p #{shared_path}/uploads"
  51. sudo "chgrp #{www_user} #{shared_path}/uploads"
  52. run "touch #{shared_path}/htaccess"
  53. sudo "chgrp #{www_user} #{shared_path}/htaccess"
  54. end
  55.  
  56. end
  57.  
  58. after "deploy:setup", "deploy:setup_upload_dir"
Add Comment
Please, Sign In to add comment