lib/ash/magento.rb in capistrano-ash-1.1.6 vs lib/ash/magento.rb in capistrano-ash-1.1.7
- old
+ new
@@ -57,10 +57,11 @@
run "rm -Rf #{latest_release}/var"
# set the file and directory permissions
ash.fixperms
run "chmod 400 #{latest_release}/pear"
+ run "chmod 400 #{latest_release}/mage"
run "chmod o+w #{latest_release}/app/etc"
end
namespace :web do
desc "Disable the application and show a message screen"
@@ -79,11 +80,16 @@
# 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"
+ 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
run "ln -nfs #{shared_path}/includes #{current_release}/includes"
@@ -111,15 +117,15 @@
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
end
# --------------------------------------------
# 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