Guest User

Untitled

a guest
Jun 18th, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. # Spree extension capistrano tasks
  2. # --------------------------------
  3. # by Christopher Maujean
  4. #
  5. # These tasks depend on the existence of the extensions hash.
  6. # The key is name of the directory in vendor/extensions.
  7. # The value is the git url of the extension.
  8. #
  9. # set :extensions, {
  10. # 'my_site' => "git@github.com:/username/spree-my-site.git"
  11. # 'ship_notification' => "git://github.com/azimuth/spree-ship-notification.git",
  12. # 'sitemaps' => "git://github.com/stephp/spree-sitemaps.git",
  13. # 'snippets' => "git://github.com/cmaujean/spree-snippets.git"
  14. # }
  15. #
  16. # $ cap -T extension
  17. # cap deploy:install_extensions # Install all the spree extensions th...
  18. # cap extension:my_site:install # Install my_site extension
  19. # cap extension:my_site:remove # Remove my_site extension
  20. # cap extension:my_site:update # update my_site extension
  21. # cap extension:ship_notification:install # Install ship_notification extension
  22. # cap extension:ship_notification:remove # Remove ship_notification extension
  23. # cap extension:ship_notification:update # update ship_notification extension
  24. # cap extension:sitemaps:install # Install sitemaps extension
  25. # cap extension:sitemaps:remove # Remove sitemaps extension
  26. # cap extension:sitemaps:update # update sitemaps extension
  27. # cap extension:snippets:install # Install snippets extension
  28. # cap extension:snippets:remove # Remove snippets extension
  29. # cap extension:snippets:update # update snippets extension
  30.  
  31. namespace :deploy do
  32. desc "Install all the spree extensions that this app requires"
  33. task :install_extensions, :roles => :app do
  34. extensions.each do |name,location|
  35. puts "Installing #{name} extension from #{location}"
  36. run "cd #{release_path} && script/extension install #{location}"
  37. end
  38. end
  39. end
  40.  
  41. # dynamic set of tasks based on the extension hash above
  42. namespace :extension do
  43. extensions.each do |name, location|
  44. namespace name.to_sym do
  45. desc "Install #{name} extension"
  46. task :install, :roles => :app do
  47. run "cd #{current_path} && script/extension install #{location}"
  48. end
  49. desc "Remove #{name} extension"
  50. task :remove, :roles => :app do
  51. run "cd #{current_path} && script/extension remove #{name}"
  52. end
  53. desc "update #{name} extension"
  54. task :update, :roles => :app do
  55. run "cd #{current_path} && script/extension install #{location} --force"
  56. end
  57. end
  58. end
  59. end
Add Comment
Please, Sign In to add comment