Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
889c62c1
Commit
889c62c1
authored
May 14, 2018
by
DJ Mountney
Committed by
Ahmad Hassan
May 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link to upstream gitaly issues for the missing restore paths
parent
b8b82aa5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
lib/backup/repository.rb
lib/backup/repository.rb
+8
-6
No files found.
lib/backup/repository.rb
View file @
889c62c1
...
@@ -70,6 +70,7 @@ module Backup
...
@@ -70,6 +70,7 @@ module Backup
Gitlab
.
config
.
repositories
.
storages
.
each
do
|
name
,
repository_storage
|
Gitlab
.
config
.
repositories
.
storages
.
each
do
|
name
,
repository_storage
|
gitaly_migrate
(
:remove_repositories
)
do
|
is_enabled
|
gitaly_migrate
(
:remove_repositories
)
do
|
is_enabled
|
# TODO: Need to find a way to do this for gitaly
# 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
unless
is_enabled
path
=
repository_storage
.
legacy_disk_path
path
=
repository_storage
.
legacy_disk_path
next
unless
File
.
exist?
(
path
)
next
unless
File
.
exist?
(
path
)
...
@@ -101,21 +102,21 @@ module Backup
...
@@ -101,21 +102,21 @@ module Backup
path_to_project_repo
=
path_to_repo
(
project
)
path_to_project_repo
=
path_to_repo
(
project
)
project
.
ensure_storage_path_exists
project
.
ensure_storage_path_exists
restore_repo_s
tatu
s
=
nil
restore_repo_s
ucces
s
=
nil
if
File
.
exist?
(
path_to_project_bundle
)
if
File
.
exist?
(
path_to_project_bundle
)
begin
begin
gitlab_shell
.
remove_repository
(
project
.
repository_storage
,
project
.
disk_path
)
if
project
.
repository_exists?
gitlab_shell
.
remove_repository
(
project
.
repository_storage
,
project
.
disk_path
)
if
project
.
repository_exists?
project
.
repository
.
create_from_bundle
path_to_project_bundle
project
.
repository
.
create_from_bundle
path_to_project_bundle
restore_repo_s
tatu
s
=
true
restore_repo_s
ucces
s
=
true
rescue
=>
e
rescue
=>
e
restore_repo_s
tatu
s
=
false
restore_repo_s
ucces
s
=
false
progress
.
puts
"Error:
#{
e
}
"
.
color
(
:red
)
progress
.
puts
"Error:
#{
e
}
"
.
color
(
:red
)
end
end
else
else
restore_repo_s
tatu
s
=
gitlab_shell
.
create_repository
(
project
.
repository_storage
,
project
.
disk_path
)
restore_repo_s
ucces
s
=
gitlab_shell
.
create_repository
(
project
.
repository_storage
,
project
.
disk_path
)
end
end
if
restore_repo_s
tatu
s
if
restore_repo_s
ucces
s
progress
.
puts
"[DONE]"
.
color
(
:green
)
progress
.
puts
"[DONE]"
.
color
(
:green
)
else
else
progress
.
puts
"[Failed] restoring
#{
project
.
full_path
}
repository"
.
color
(
:red
)
progress
.
puts
"[Failed] restoring
#{
project
.
full_path
}
repository"
.
color
(
:red
)
...
@@ -123,6 +124,7 @@ module Backup
...
@@ -123,6 +124,7 @@ module Backup
gitaly_migrate
(
:restore_custom_hooks
)
do
|
is_enabled
|
gitaly_migrate
(
:restore_custom_hooks
)
do
|
is_enabled
|
# TODO: Need to find a way to do this for gitaly
# 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
unless
is_enabled
in_path
(
path_to_tars
(
project
))
do
|
dir
|
in_path
(
path_to_tars
(
project
))
do
|
dir
|
cmd
=
%W(tar -xf
#{
path_to_tars
(
project
,
dir
)
}
-C
#{
path_to_project_repo
}
#{
dir
}
)
cmd
=
%W(tar -xf
#{
path_to_tars
(
project
,
dir
)
}
-C
#{
path_to_project_repo
}
#{
dir
}
)
...
@@ -144,7 +146,7 @@ module Backup
...
@@ -144,7 +146,7 @@ module Backup
gitlab_shell
.
remove_repository
(
wiki
.
repository_storage
,
wiki
.
disk_path
)
if
wiki
.
repository_exists?
gitlab_shell
.
remove_repository
(
wiki
.
repository_storage
,
wiki
.
disk_path
)
if
wiki
.
repository_exists?
wiki
.
repository
.
create_from_bundle
(
path_to_wiki_bundle
)
wiki
.
repository
.
create_from_bundle
(
path_to_wiki_bundle
)
progress
.
puts
"[DONE]"
.
color
(
:green
)
progress
.
puts
"[DONE]"
.
color
(
:green
)
rescue
StandardError
=>
e
rescue
=>
e
progress
.
puts
"[Failed] restoring
#{
wiki
.
full_path
}
wiki"
.
color
(
:red
)
progress
.
puts
"[Failed] restoring
#{
wiki
.
full_path
}
wiki"
.
color
(
:red
)
progress
.
puts
"Error
#{
e
}
"
.
color
(
:red
)
progress
.
puts
"Error
#{
e
}
"
.
color
(
:red
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment