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:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-07-27 10:11:46 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-07-27 10:11:46 +0400
commit67ef96ea5f721cc620f3e931f05d918c904ec74e (patch)
tree8f09a01918e2ad079a1a2b3736a5f6dbc633c1e4 /lib
parent18f83016b15a1ad388ccb85a6e0878e7f5f14527 (diff)
parentec01cbef9452dcbe7a09f1709370a7939f66c542 (diff)
Merge pull request #1129 from meskyanichi/master
Potential solution for current `rake gitlab:app:backup_restore` issues.
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/gitlab/backup.rake6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake
index 014483d4e8c..5ae51f52218 100644
--- a/lib/tasks/gitlab/backup.rake
+++ b/lib/tasks/gitlab/backup.rake
@@ -121,7 +121,7 @@ namespace :gitlab do
backup_path_repo = File.join(Gitlab.config.backup_path, "repositories")
FileUtils.mkdir_p(backup_path_repo) until Dir.exists?(backup_path_repo)
puts "Dumping repositories:"
- project = Project.all.map { |n| [n.name,n.path_to_repo] }
+ project = Project.all.map { |n| [n.path,n.path_to_repo] }
project << ["gitolite-admin.git", File.join(File.dirname(project.first.second), "gitolite-admin.git")]
project.each do |project|
print "- Dumping repository #{project.first}... "
@@ -136,12 +136,14 @@ namespace :gitlab do
task :repo_restore => :environment do
backup_path_repo = File.join(Gitlab.config.backup_path, "repositories")
puts "Restoring repositories:"
- project = Project.all.map { |n| [n.name,n.path_to_repo] }
+ project = Project.all.map { |n| [n.path,n.path_to_repo] }
project << ["gitolite-admin.git", File.join(File.dirname(project.first.second), "gitolite-admin.git")]
project.each do |project|
print "- Restoring repository #{project.first}... "
FileUtils.rm_rf(project.second) if File.dirname(project.second) # delet old stuff
if Kernel.system("cd #{File.dirname(project.second)} > /dev/null 2>&1 && git clone --bare #{backup_path_repo}/#{project.first}.bundle #{project.first}.git > /dev/null 2>&1")
+ Kernel.system("sudo chmod -R g+rwX #{Gitlab.config.git_base_path}")
+ Kernel.system("sudo chown -R #{Gitlab.config.ssh_user}:#{Gitlab.config.ssh_user} #{Gitlab.config.git_base_path}")
puts "[DONE]".green
else
puts "[FAILED]".red