lib/ash/drupal.rb in capistrano-ash-1.1.8 vs lib/ash/drupal.rb in capistrano-ash-1.1.10
- old
+ new
@@ -33,11 +33,11 @@
# attempt to create files needed for proper deployment
system("cp .htaccess htaccess.dist")
end
desc "Setup shared application directories and permissions after initial setup"
- task :setup_shared, :roles => :web do
+ task :setup_shared do
# remove Capistrano specific directories
run "rm -Rf #{shared_path}/log"
run "rm -Rf #{shared_path}/pids"
run "rm -Rf #{shared_path}/system"
@@ -49,28 +49,28 @@
# set correct permissions
run "chmod -R 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
# remove shared directories
multisites.each_pair do |folder, url|
run "mv #{latest_release}/sites/#{folder} #{latest_release}/sites/#{url}"
run "rm -Rf #{latest_release}/sites/#{url}/files"
end
end
namespace :web do
desc "Disable the application and show a message screen"
- task :disable do
+ task :disable, :roles => :web do
multisites.each_pair do |folder, url|
run "#{drush_bin} -l #{url} -r #{latest_release} vset --yes site_offline 1"
end
end
desc "Enable the application and remove the message screen"
- task :enable do
+ task :enable, :roles => :web do
multisites.each_pair do |folder, url|
run "#{drush_bin} -l #{url} -r #{latest_release} vdel --yes site_offline"
end
end
end
@@ -96,11 +96,11 @@
# --------------------------------------------
# Drupal-specific methods
# --------------------------------------------
namespace :drupal do
desc "Symlink shared directories"
- task :symlink, :except => { :no_release => true } do
+ task :symlink, :roles => :web, :except => { :no_release => true } do
multisites.each_pair do |folder, url|
# symlinks the appropriate environment's settings.php file
symlink_config_file
run "ln -nfs #{shared_path}/#{url}/files #{latest_release}/sites/#{url}/files"
@@ -113,11 +113,11 @@
Assumes the environment's settings file will be in one of two formats:
settings.<environment>.php => new default
settings.php.<environment> => deprecated
DESC
- task :symlink_config_file, :except => { :no_release => true} do
+ task :symlink_config_file, :roles => :web, :except => { :no_release => true} do
multisites.each_pair do |folder, url|
drupal_app_site_dir = " #{latest_release}/sites/#{url}"
case true
when remote_file_exists?("#{drupal_app_site_dir}/settings.#{stage}.php")
@@ -129,24 +129,24 @@
end
end
end
desc "Replace local database paths with remote paths"
- task :updatedb, :except => { :no_release => true } do
+ task :updatedb, :roles => :web, :except => { :no_release => true } do
multisites.each_pair do |folder, url|
run "#{drush_bin} -l #{url} -r #{current_path} sqlq \"UPDATE {files} SET filepath = REPLACE(filepath,'sites/#{folder}/files','sites/#{url}/files');\""
end
end
desc "Clear all Drupal cache"
- task :clearcache, :except => { :no_release => true } do
+ task :clearcache, :roles => :web, :except => { :no_release => true } do
multisites.each_pair do |folder, url|
run "#{drush_bin} -l #{url} -r #{current_path} cache-clear all"
end
end
desc "Protect system files"
- task :protect, :except => { :no_release => true } do
+ task :protect, :roles => :web, :except => { :no_release => true } do
multisites.each_pair do |folder, url|
run "chmod 644 #{latest_release}/sites/#{url}/settings.php*"
end
end
end