lib/demonz/drupal.rb in capistrano-demonz-0.0.15 vs lib/demonz/drupal.rb in capistrano-demonz-0.0.16

- old
+ new

@@ -107,11 +107,11 @@ set :previous_release, releases.length > 2 ? File.join(releases_path, releases[-3]) : nil # Backup files dir. removed_files_bak = File.join(tmp_backups_path, "#{removed_release}.files.tar.gz") files_dir_location = File.join(shared_path, 'default') - run "cd #{files_dir_location} && tar -cvpf - files | #{try_sudo} gzip -c --best > #{removed_files_bak}" + run "cd #{files_dir_location} && tar -cpf - files | #{try_sudo} gzip -c --best > #{removed_files_bak}" logger.info "files directory backed up" # Update 'current' symlink to previous release if removing latest. if previous_release.nil? logger.info "no previous release detected, removing symlink" @@ -122,11 +122,11 @@ # Restore previous files dir. previous_files_bak = File.join(backups_path, "files_before_#{removed_release}.tar.gz") if remote_file_exists?(previous_files_bak) logger.info "restoring previous files backup" - run "cd #{files_dir_location} && #{try_sudo} tar -xvpzf #{previous_files_bak}" + run "cd #{files_dir_location} && #{try_sudo} tar -xpzf #{previous_files_bak}" end end end # Remove database. @@ -257,12 +257,12 @@ task :run_update_scripts, :roles => :web, :except => { :no_release => true } do update_script_file = File.join(latest_release, 'sites', 'all', 'scripts', release_name, 'update.sh') if remote_file_exists?(update_script_file) # Make sure script is executable. - run "#{try_sudo} chmod go+x #{update_script_file}" - run "cd #{latest_release} && #{try_sudo} #{update_script_file}" + run "#{try_sudo} chmod ug+x #{update_script_file}" + run "cd #{latest_release} && #{update_script_file}" end end desc "Set release name for site" task :update_visible_release_name, :roles => :web, :except => { :no_release => true } do @@ -323,19 +323,19 @@ run_update_scripts update_visible_release_name compile_sass if uses_sass # Run drush updb just incase - run "#{drush_bin} -r #{latest_release} updb" + run "#{drush_bin} -r #{latest_release} updb -y" end desc "Backup the shared 'files' directory" task :backup_files_dir, :roles => :web, :except => { :no_release => true } do set :archive_name, "files_before_#{release_name}.tar.gz" set :files_dir_location, File.join(shared_path, 'default') logger.debug "Creating a Tarball of the files directory in #{backups_path}/#{archive_name}" - run "cd #{files_dir_location} && tar -cvpf - files | #{try_sudo} gzip -c --best > #{backups_path}/#{archive_name}" + run "cd #{files_dir_location} && tar -cpf - files | #{try_sudo} gzip -c --best > #{backups_path}/#{archive_name}" end desc "Clear all Drupal cache" task :clearcache, :roles => :web, :except => { :no_release => true } do run "#{drush_bin} -r #{latest_release} cache-clear all" @@ -374,14 +374,14 @@ files_dir = File.join(files_dir_location, 'files') files_dir_backup_archive = "files_after_#{old_release}_OLD" on_rollback { run "#{try_sudo} rm #{files_dir}" if remote_file_exists?(files_dir_backup_archive) && remote_dir_exists?(files_dir) - run "#{try_sudo} tar -xvzf #{files_dir_backup_archive} -C #{files_dir_location}" if remote_file_exists?(files_dir_backup_archive) + run "#{try_sudo} tar -xzf #{files_dir_backup_archive} -C #{files_dir_location}" if remote_file_exists?(files_dir_backup_archive) } - run "cd #{files_dir_location} && tar -cvpf - files | gzip -c --best > #{backups_path}/#{files_dir_backup_archive}" - run "#{try_sudo} tar -xvzf #{files_backup_file} -C #{files_dir_location}" + run "cd #{files_dir_location} && tar -cpf - files | gzip -c --best > #{backups_path}/#{files_dir_backup_archive}" + run "#{try_sudo} tar -xzf #{files_backup_file} -C #{files_dir_location}" end else abort "could not rollback the code because there is no prior release" end end