Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Spree extension capistrano tasks
- # --------------------------------
- # by Christopher Maujean
- #
- # These tasks depend on the existence of the extensions hash.
- # The key is name of the directory in vendor/extensions.
- # The value is the git url of the extension.
- #
- # set :extensions, {
- # 'my_site' => "git@github.com:/username/spree-my-site.git"
- # 'ship_notification' => "git://github.com/azimuth/spree-ship-notification.git",
- # 'sitemaps' => "git://github.com/stephp/spree-sitemaps.git",
- # 'snippets' => "git://github.com/cmaujean/spree-snippets.git"
- # }
- #
- # $ cap -T extension
- # cap deploy:install_extensions # Install all the spree extensions th...
- # cap extension:my_site:install # Install my_site extension
- # cap extension:my_site:remove # Remove my_site extension
- # cap extension:my_site:update # update my_site extension
- # cap extension:ship_notification:install # Install ship_notification extension
- # cap extension:ship_notification:remove # Remove ship_notification extension
- # cap extension:ship_notification:update # update ship_notification extension
- # cap extension:sitemaps:install # Install sitemaps extension
- # cap extension:sitemaps:remove # Remove sitemaps extension
- # cap extension:sitemaps:update # update sitemaps extension
- # cap extension:snippets:install # Install snippets extension
- # cap extension:snippets:remove # Remove snippets extension
- # cap extension:snippets:update # update snippets extension
- namespace :deploy do
- desc "Install all the spree extensions that this app requires"
- task :install_extensions, :roles => :app do
- extensions.each do |name,location|
- puts "Installing #{name} extension from #{location}"
- run "cd #{release_path} && script/extension install #{location}"
- end
- end
- end
- # dynamic set of tasks based on the extension hash above
- namespace :extension do
- extensions.each do |name, location|
- namespace name.to_sym do
- desc "Install #{name} extension"
- task :install, :roles => :app do
- run "cd #{current_path} && script/extension install #{location}"
- end
- desc "Remove #{name} extension"
- task :remove, :roles => :app do
- run "cd #{current_path} && script/extension remove #{name}"
- end
- desc "update #{name} extension"
- task :update, :roles => :app do
- run "cd #{current_path} && script/extension install #{location} --force"
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment