Created
October 17, 2010 00:29
-
-
Save cmaujean/630404 to your computer and use it in GitHub Desktop.
A set of extension management related tasks for using Capistrano on a spreecommerce install. For spree-0-11-stable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' => "[email protected]:/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment