summaryrefslogtreecommitdiff
path: root/lib/backup/database.rb
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-10-01 15:43:27 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-10-01 15:43:27 +0200
commit02bf992f378f8b56ec7e698b5d603ded895dd0a4 (patch)
tree7d7da4c27f06ffcfade1abfcc26b6b13cdd706b4 /lib/backup/database.rb
parent8b1da505e0f46f720d5097c4850ee83f10cc8d51 (diff)
downloadgitlab-ce-02bf992f378f8b56ec7e698b5d603ded895dd0a4.tar.gz
Fail harder in the backup script
This change also shows the output of failed Git commands during the backup.
Diffstat (limited to 'lib/backup/database.rb')
-rw-r--r--lib/backup/database.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb
index 7b6908ccad8..d12d30a9110 100644
--- a/lib/backup/database.rb
+++ b/lib/backup/database.rb
@@ -21,6 +21,7 @@ module Backup
system('pg_dump', config['database'], out: db_file_name)
end
report_success(success)
+ abort 'Backup failed' unless success
end
def restore
@@ -37,6 +38,7 @@ module Backup
system('psql', config['database'], '-f', db_file_name)
end
report_success(success)
+ abort 'Restore failed' unless success
end
protected