Commit 28a95f12 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'restore_wikis' into 'master'

Fix wiki restore

Seems 4a5044e3 only fixed git repos restore. This MR provides the same functionality that was introduced in the aforementioned commit, but for wikis.

See merge request !247
parents b08a80fd 880478b2
...@@ -2,7 +2,7 @@ v 7.6.0 ...@@ -2,7 +2,7 @@ v 7.6.0
- Fork repository to groups - Fork repository to groups
- New rugged version - New rugged version
- Add CRON=1 backup setting for quiet backups - Add CRON=1 backup setting for quiet backups
- - Fix failing wiki restore
- -
- Add optional Sidekiq MemoryKiller middleware (enabled via SIDEKIQ_MAX_RSS env variable) - Add optional Sidekiq MemoryKiller middleware (enabled via SIDEKIQ_MAX_RSS env variable)
- -
......
...@@ -79,9 +79,14 @@ module Backup ...@@ -79,9 +79,14 @@ module Backup
wiki = ProjectWiki.new(project) wiki = ProjectWiki.new(project)
if File.exists?(path_to_bundle(wiki))
$progress.print " * #{wiki.path_with_namespace} ... " $progress.print " * #{wiki.path_with_namespace} ... "
if File.exists?(path_to_bundle(wiki))
cmd = %W(git clone --bare #{path_to_bundle(wiki)} #{path_to_repo(wiki)}) cmd = %W(git clone --bare #{path_to_bundle(wiki)} #{path_to_repo(wiki)})
else
cmd = %W(git init --bare #{path_to_repo(wiki)})
end
if system(*cmd, silent) if system(*cmd, silent)
$progress.puts " [DONE]".green $progress.puts " [DONE]".green
else else
...@@ -90,7 +95,6 @@ module Backup ...@@ -90,7 +95,6 @@ module Backup
abort 'Restore failed' abort 'Restore failed'
end end
end end
end
$progress.print 'Put GitLab hooks in repositories dirs'.yellow $progress.print 'Put GitLab hooks in repositories dirs'.yellow
cmd = "#{Gitlab.config.gitlab_shell.path}/bin/create-hooks" cmd = "#{Gitlab.config.gitlab_shell.path}/bin/create-hooks"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment