diff options
author | DJ Mountney <david@twkie.net> | 2018-05-14 23:49:04 +0300 |
---|---|---|
committer | Ahmad Hassan <ahmad.hassan612@gmail.com> | 2018-05-16 13:28:15 +0300 |
commit | 889c62c1e3a2c11e726d1160d92ff83cb3e0fd7d (patch) | |
tree | f8d3a9fc1660636dc6b03fafd16418fcf90d80cd /lib | |
parent | b8b82aa50e677d6e38b32080a65b48211350e9af (diff) |
Link to upstream gitaly issues for the missing restore paths
Diffstat (limited to 'lib')
-rw-r--r-- | lib/backup/repository.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb index 38751a1040e..ba464368042 100644 --- a/lib/backup/repository.rb +++ b/lib/backup/repository.rb @@ -70,6 +70,7 @@ module Backup Gitlab.config.repositories.storages.each do |name, repository_storage| gitaly_migrate(:remove_repositories) do |is_enabled| # TODO: Need to find a way to do this for gitaly + # Gitaly discussion issue: https://gitlab.com/gitlab-org/gitaly/issues/1194 unless is_enabled path = repository_storage.legacy_disk_path next unless File.exist?(path) @@ -101,21 +102,21 @@ module Backup path_to_project_repo = path_to_repo(project) project.ensure_storage_path_exists - restore_repo_status = nil + restore_repo_success = nil if File.exist?(path_to_project_bundle) begin gitlab_shell.remove_repository(project.repository_storage, project.disk_path) if project.repository_exists? project.repository.create_from_bundle path_to_project_bundle - restore_repo_status = true + restore_repo_success = true rescue => e - restore_repo_status = false + restore_repo_success = false progress.puts "Error: #{e}".color(:red) end else - restore_repo_status = gitlab_shell.create_repository(project.repository_storage, project.disk_path) + restore_repo_success = gitlab_shell.create_repository(project.repository_storage, project.disk_path) end - if restore_repo_status + if restore_repo_success progress.puts "[DONE]".color(:green) else progress.puts "[Failed] restoring #{project.full_path} repository".color(:red) @@ -123,6 +124,7 @@ module Backup gitaly_migrate(:restore_custom_hooks) do |is_enabled| # TODO: Need to find a way to do this for gitaly + # Gitaly migration issue: https://gitlab.com/gitlab-org/gitaly/issues/1195 unless is_enabled in_path(path_to_tars(project)) do |dir| cmd = %W(tar -xf #{path_to_tars(project, dir)} -C #{path_to_project_repo} #{dir}) @@ -144,7 +146,7 @@ module Backup gitlab_shell.remove_repository(wiki.repository_storage, wiki.disk_path) if wiki.repository_exists? wiki.repository.create_from_bundle(path_to_wiki_bundle) progress.puts "[DONE]".color(:green) - rescue StandardError => e + rescue => e progress.puts "[Failed] restoring #{wiki.full_path} wiki".color(:red) progress.puts "Error #{e}".color(:red) end |