Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
  • 8 commits
  • 4 files changed
  • 0 commit comments
  • 2 contributors
View
7 CHANGELOG.rdoc
@@ -1,3 +1,10 @@
+== 1.1.18
+* FIXED: deploy:setup_backup now also attempts to create the :tmp_backups_path directory
+* added deploy:setup_backup to the backup:default stack so it's always called first (no more messy task chains!)
+* altered Magento's backup:default task to only do a database dump to the backups directory. File level backup will come at a later date.
+* altered Drupal's default for :dump_options which are now empty (equivalent to a run-of-the-mill mysqldump command) due to MYISAM vs INNODB concerns
+
+
== 1.1.17
* FIXED: deploy:setup now creates directories with 755 permissions (instead of g+w)
* abstracted the ash:fixperms functionality into 2 methods (set_perms_files and set_perms_dirs) in common.rb that take 2 arguments: the file path to the desired directory and the desired permissions
View
3  lib/ash/base.rb
@@ -115,7 +115,7 @@
desc "Setup backup directory for database and web files"
task :setup_backup, :except => { :no_release => true } do
- run "#{try_sudo} mkdir -p #{backups_path} && #{try_sudo} chmod 755 #{backups_path}"
+ run "#{try_sudo} mkdir -p #{backups_path} #{tmp_backups_path} && #{try_sudo} chmod 755 #{backups_path}"
end
end
@@ -279,6 +279,7 @@
namespace :backup do
desc "Perform a backup of web and database files"
task :default do
+ deploy.setup_backup
db
web
cleanup
View
23 lib/ash/drupal.rb
@@ -13,6 +13,8 @@
# --------------------------------------------
proc{_cset( :multisites, {"#{application}" => "#{application}"} )}
set :drush_bin, "drush"
+ _cset :dump_options, "" # blank options b/c of MYISAM engine (unless anyone knows options that should be included)
+
# --------------------------------------------
# Ubercart Files/Folders
@@ -87,6 +89,27 @@
end
end
end
+
+ # --------------------------------------------
+ # Remote/Local database migration tasks
+ # --------------------------------------------
+ namespace :db do
+ task :local_export do
+ mysqldump = fetch(:mysqldump, "mysqldump")
+ dump_options = fetch(:dump_options, "")
+
+ system "#{mysqldump} #{dump_options} --opt -h#{db_local_host} -u#{db_local_user} -p#{db_local_pass} #{db_local_name} | gzip -c --best > #{db_local_name}.sql.gz"
+ end
+
+ desc "Create a compressed MySQL dumpfile of the remote database"
+ task :remote_export, :roles => :db do
+ mysqldump = fetch(:mysqldump, "mysqldump")
+ dump_options = fetch(:dump_options, "")
+
+ run "#{mysqldump} #{dump_options} --opt -h#{db_remote_host} -u#{db_remote_user} -p#{db_remote_pass} #{db_remote_name} | gzip -c --best > #{deploy_to}/#{db_remote_name}.sql.gz"
+ end
+
+ end
namespace :backup do
desc "Perform a backup of database files"
View
3  lib/ash/magento.rb
@@ -130,6 +130,7 @@
namespace :backup do
desc "Perform a backup of ONLY database SQL files"
task :default do
+ deploy.setup_backup
db
cleanup
end
@@ -143,7 +144,7 @@
filename = "#{backups_path}/#{dbname}_dump-#{Time.now.to_s.gsub(/ /, "_")}.sql.gz"
# dump the database for the proper environment
- run "#{mysldump} #{dump_options} -u #{dbuser} -p #{dbname} | gzip -c --best > #{filename}" do |ch, stream, out|
+ run "#{mysqldump} #{dump_options} -u #{dbuser} -p #{dbname} | gzip -c --best > #{filename}" do |ch, stream, out|
ch.send_data "#{dbpass}\n" if out =~ /^Enter password:/
end
else

No commit comments for this range

Something went wrong with that request. Please try again.