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 CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.1.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{capistrano-ash}
8
- s.version = "1.1.0"
8
+ s.version = "1.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["August Ash"]
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
- puts "Backing up the database now and putting dump file in the previous release directory"
204
- # define the filename (include the current_path so the dump file will be within the directory)
205
- filename = "#{current_path}/#{dbname}_dump-#{Time.now.to_s.gsub(/ /, "_")}.sql.gz"
206
- # dump the database for the proper environment
207
- run "mysqldump -u #{dbuser} -p #{dbname} | gzip -c --best > #{filename}" do |ch, stream, out|
208
- ch.send_data "#{dbpass}\n" if out =~ /^Enter password:/
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
- puts "Backing up the database now and putting dump file in the previous release directory"
78
- multisites.each_pair do |folder, url|
79
- # define the filename (include the current_path so the dump file will be within the directory)
80
- filename = "#{current_path}/#{folder}_dump-#{Time.now.to_s.gsub(/ /, "_")}.sql.gz"
81
- # dump the database for the proper environment
82
- run "#{drush_bin} -l #{url} -r #{current_path} sql-dump | gzip -c --best > #{filename}"
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
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: capistrano-ash
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.1
5
+ version: 1.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - August Ash