Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2015-08-21 19:10:12 +0300
committerRobert Speicher <robert@gitlab.com>2015-08-21 19:10:12 +0300
commitf5b3bf84ad10a03c58c161e84ef919661c84267c (patch)
tree52df8b2a516e9179cbfb23bf56a5c629c3551271 /lib
parent9bd6c41a026c8f736f1238d326dd8b073e8de827 (diff)
parent4cd06867c76daca698bc4a9d23e1875f4b4866d5 (diff)
Merge branch 'fix-backup-restore' into 'master'
Do not delete the SQL dump too early The change in baa157926d432f404a41c31ad6514ff8d5366269 broke backup restore fucnctionality. This would not lead to data loss, but it prevented the restore script from working. This bug exists only in 7.14.0 release candidate versions, not in 7.13. Reported in https://github.com/gitlabhq/gitlabhq/issues/9571 . See merge request !1182
Diffstat (limited to 'lib')
-rw-r--r--lib/backup/database.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb
index 939f28fc1c6..ce75476a09b 100644
--- a/lib/backup/database.rb
+++ b/lib/backup/database.rb
@@ -7,14 +7,15 @@ module Backup
def initialize
@config = YAML.load_file(File.join(Rails.root,'config','database.yml'))[Rails.env]
@db_dir = File.join(Gitlab.config.backup.path, 'db')
+ end
+
+ def dump
FileUtils.rm_rf(@db_dir)
# Ensure the parent dir of @db_dir exists
FileUtils.mkdir_p(Gitlab.config.backup.path)
# Fail if somebody raced to create @db_dir before us
FileUtils.mkdir(@db_dir, mode: 0700)
- end
- def dump
success = case config["adapter"]
when /^mysql/ then
$progress.print "Dumping MySQL database #{config['database']} ... "