lib/ash/hosted_magento.rb in capistrano-ash-1.1.7 vs lib/ash/hosted_magento.rb in capistrano-ash-1.1.8

- old
+ new

@@ -1,8 +1,7 @@ # Required base libraries -require 'ash/base' -require 'railsless-deploy' +require 'ash/magento' # Bootstrap Capistrano instance configuration = Capistrano::Configuration.respond_to?(:instance) ? Capistrano::Configuration.instance(:must_exist) : Capistrano.configuration(:must_exist) @@ -14,25 +13,15 @@ set :scm_username, "remotesvn" # -------------------------------------------- # Task chains # -------------------------------------------- - after "deploy:setup", "deploy:setup_local" - after "deploy:finalize_update", "magento:activate_config" - after "deploy:symlink", "magento:symlink" - after "deploy", "magento:purge_cache" # -------------------------------------------- # Overloaded tasks # -------------------------------------------- - namespace :deploy do - desc "Setup local files necessary for deployment" - task :setup_local do - # attempt to create files needed for proper deployment - system("touch htaccess.dist app/etc/local.xml.staging app/etc/local.xml.production") - end - + namespace :deploy do desc "Setup shared application directories and permissions after initial setup" task :setup_shared do # remove Capistrano specific directories run "rm -Rf #{shared_path}/log" run "rm -Rf #{shared_path}/pids" @@ -63,22 +52,10 @@ run "rm -Rf #{latest_release}/var" # set the file and directory permissions ash.fixperms end - - namespace :web do - desc "Disable the application and show a message screen" - task :disable, :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 - run "rm #{current_path}/maintenance.flag" - end - end end # -------------------------------------------- # Overloaded Ash tasks # -------------------------------------------- @@ -88,53 +65,6 @@ # chmod the files and directories. run "find #{latest_release} -type d -exec chmod 755 {} \\;" run "find #{latest_release} -type f -exec chmod 644 {} \\;" end end - - # -------------------------------------------- - # Magento specific tasks - # -------------------------------------------- - namespace :magento do - desc "Set appropriate configuration values for the stage" - task :activate_config, :except => { :no_release => true } do - run "cp -f #{latest_release}/app/etc/local.xml.#{stage} #{latest_release}/app/etc/local.xml" - end - - desc "Symlink shared directories" - task :symlink, :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 - run "rm -Rf #{shared_path}/var/cache/*" - end - - desc "Watch Magento system log" - task :watch_logs, :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 - 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 - end - end - - # -------------------------------------------- - # Custom tasks - # -------------------------------------------- - - # update core_config_data; set value = "domain" where scope_id = 0 and path = "web/unsecure/base_url" end