summaryrefslogtreecommitdiff
path: root/lib/tasks/gitlab/backup.rake
diff options
context:
space:
mode:
authorAngus MacArthur <amacarthur@blackberry.com>2013-05-29 15:19:23 -0400
committerAngus MacArthur <amacarthur@blackberry.com>2013-05-30 09:58:36 -0400
commit9c82bca5ee274d700ec3166d4521d4c6d2ff896c (patch)
treebae3e3e7f91e4f3fe1b757a3504a33eb8ea63fdb /lib/tasks/gitlab/backup.rake
parent6393757707d5686b79be789303cd7cdbbf09cb11 (diff)
downloadgitlab-ce-9c82bca5ee274d700ec3166d4521d4c6d2ff896c.tar.gz
fixes for gitlab restore with non-standard backup and repo dirs
These fixes will allow a restore of gitlab when the backups and repositories directories are in non-standard locations (ie sub-dirs of gitlabhq). Also allows the restore to be run from script overriding the need of a user to confirm the rebuild of the authorized_keys file.
Diffstat (limited to 'lib/tasks/gitlab/backup.rake')
-rw-r--r--lib/tasks/gitlab/backup.rake3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake
index 65d99d1aea3..920d29a444e 100644
--- a/lib/tasks/gitlab/backup.rake
+++ b/lib/tasks/gitlab/backup.rake
@@ -90,6 +90,9 @@ namespace :gitlab do
settings = YAML.load_file("backup_information.yml")
ENV["VERSION"] = "#{settings[:db_version]}" if settings[:db_version].to_i > 0
+ # backups directory is not always sub of Rails root and able to execute the git rev-parse below
+ Dir.chdir(Rails.root)
+
# restoring mismatching backups can lead to unexpected problems
if settings[:gitlab_version] != %x{git rev-parse HEAD}.gsub(/\n/,"")
puts "GitLab version mismatch:".red