lib/ash/magento.rb in capistrano-ash-1.1.8 vs lib/ash/magento.rb in capistrano-ash-1.1.10

- old
+ new

@@ -23,11 +23,12 @@ namespace :deploy do desc "Setup local files necessary for deployment" task :setup_local do # attempt to create files needed for proper deployment system("cp .htaccess htaccess.dist") - system("touch app/etc/local.staging.xml app/etc/local.production.xml") + system("cp app/etc/local.xml app/etc/local.xml.staging") + system("cp app/etc/local.xml app/etc/local.xml.production") end desc "Setup shared application directories and permissions after initial setup" task :setup_shared do # remove Capistrano specific directories @@ -44,11 +45,11 @@ # set correct permissions run "chmod 777 #{shared_path}/*" end desc "[internal] Touches up the released code. This is called by update_code after the basic deploy finishes." - task :finalize_update, :except => { :no_release => true } do + task :finalize_update, :roles => :web, :except => { :no_release => true } do # synchronize media directory with shared data sudo "rsync -rltDvzog #{latest_release}/media/ #{shared_path}/media/" sudo "chmod -R 777 #{shared_path}/media/" # remove directories that will be shared @@ -64,59 +65,59 @@ run "chmod o+w #{latest_release}/app/etc" end namespace :web do desc "Disable the application and show a message screen" - task :disable, :except => { :no_release => true } do + task :disable, :roles => :web, :except => { :no_release => true } do run "touch #{current_path}/maintenance.flag" end desc "Enable the application and remove the message screen" - task :enable, :except => { :no_release => true } do + task :enable, :roles => :web, :except => { :no_release => true } do run "rm #{current_path}/maintenance.flag" end end end # -------------------------------------------- # Magento specific tasks # -------------------------------------------- namespace :magento do desc "Set appropriate configuration values for the stage" - task :activate_config, :except => { :no_release => true } do + task :activate_config, :roles => :web, :except => { :no_release => true } do case true when remote_file_exists?("#{latest_release}/app/etc/local.#{stage}.xml") run "cp -f #{latest_release}/app/etc/local.#{stage}.xml #{latest_release}/app/etc/local.xml" when remote_file_exists?("#{latest_release}/app/etc/local.xml.#{stage}") run "cp -f #{latest_release}/app/etc/local.xml.#{stage} #{latest_release}/app/etc/local.xml" end end desc "Symlink shared directories" - task :symlink, :except => { :no_release => true } do + task :symlink, :roles => :web, :except => { :no_release => true } do run "ln -nfs #{shared_path}/includes #{current_release}/includes" run "ln -nfs #{shared_path}/media #{current_release}/media" run "ln -nfs #{shared_path}/sitemap #{current_release}/sitemap" run "ln -nfs #{shared_path}/var #{current_release}/var" end desc "Purge Magento cache directory" - task :purge_cache, :except => { :no_release => true } do + task :purge_cache, :roles => :web, :except => { :no_release => true } do sudo "rm -Rf #{shared_path}/var/cache/*" end desc "Watch Magento system log" - task :watch_logs, :except => { :no_release => true } do + task :watch_logs, :roles => :web, :except => { :no_release => true } do run "tail -f #{shared_path}/var/log/system.log" do |channel, stream, data| puts # for an extra line break before the host name puts "#{channel[:host]}: #{data}" break if stream == :err end end desc "Watch Magento exception log" - task :watch_exceptions, :except => { :no_release => true } do + task :watch_exceptions, :roles => :web, :except => { :no_release => true } do run "tail -f #{shared_path}/var/log/exception.log" do |channel, stream, data| puts # for an extra line break before the host name puts "#{channel[:host]}: #{data}" break if stream == :err end @@ -127,6 +128,6 @@ # Custom tasks # -------------------------------------------- # update core_config_data; set value = "domain" where scope_id = 0 and path = "web/unsecure/base_url" -end \ No newline at end of file +end