capistrano-ash 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/capistrano-ash.gemspec +1 -1
- data/lib/ash/base.rb +10 -6
- data/lib/ash/drupal.rb +10 -6
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.2
|
data/capistrano-ash.gemspec
CHANGED
data/lib/ash/base.rb
CHANGED
@@ -200,12 +200,16 @@ configuration.load do
|
|
200
200
|
|
201
201
|
desc "Perform a backup of database files"
|
202
202
|
task :db, :roles => :db do
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
203
|
+
if previous_release
|
204
|
+
puts "Backing up the database now and putting dump file in the previous release directory"
|
205
|
+
# define the filename (include the current_path so the dump file will be within the directory)
|
206
|
+
filename = "#{current_path}/#{dbname}_dump-#{Time.now.to_s.gsub(/ /, "_")}.sql.gz"
|
207
|
+
# dump the database for the proper environment
|
208
|
+
run "mysqldump -u #{dbuser} -p #{dbname} | gzip -c --best > #{filename}" do |ch, stream, out|
|
209
|
+
ch.send_data "#{dbpass}\n" if out =~ /^Enter password:/
|
210
|
+
end
|
211
|
+
else
|
212
|
+
logger.important "no previous release to backup to; backup of database skipped"
|
209
213
|
end
|
210
214
|
end
|
211
215
|
|
data/lib/ash/drupal.rb
CHANGED
@@ -74,12 +74,16 @@ configuration.load do
|
|
74
74
|
namespace :backup do
|
75
75
|
desc "Perform a backup of database files"
|
76
76
|
task :db, :roles => :db do
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
77
|
+
if previous_release
|
78
|
+
puts "Backing up the database now and putting dump file in the previous release directory"
|
79
|
+
multisites.each_pair do |folder, url|
|
80
|
+
# define the filename (include the current_path so the dump file will be within the directory)
|
81
|
+
filename = "#{current_path}/#{folder}_dump-#{Time.now.to_s.gsub(/ /, "_")}.sql.gz"
|
82
|
+
# dump the database for the proper environment
|
83
|
+
run "#{drush_bin} -l #{url} -r #{current_path} sql-dump | gzip -c --best > #{filename}"
|
84
|
+
end
|
85
|
+
else
|
86
|
+
logger.important "no previous release to backup; backup of database skipped"
|
83
87
|
end
|
84
88
|
end
|
85
89
|
end
|