Commit 6c206805ae445b7052d98640cb0083256d836db1
1 parent
3df5fee4
Exists in
master
and in
4 other branches
Backup/restore wiki repos too
Showing
1 changed file
with
22 additions
and
0 deletions
Show diff stats
lib/backup/repository.rb
@@ -23,6 +23,17 @@ module Backup | @@ -23,6 +23,17 @@ module Backup | ||
23 | else | 23 | else |
24 | puts "[FAILED]".red | 24 | puts "[FAILED]".red |
25 | end | 25 | end |
26 | + | ||
27 | + wiki = GollumWiki.new(project) | ||
28 | + | ||
29 | + if File.exists?(path_to_repo(wiki)) | ||
30 | + print " * #{wiki.path_with_namespace} ... " | ||
31 | + if system("cd #{path_to_repo(wiki)} > /dev/null 2>&1 && git bundle create #{path_to_bundle(wiki)} --all > /dev/null 2>&1") | ||
32 | + puts " [DONE]".green | ||
33 | + else | ||
34 | + puts " [FAILED]".red | ||
35 | + end | ||
36 | + end | ||
26 | end | 37 | end |
27 | end | 38 | end |
28 | 39 | ||
@@ -45,6 +56,17 @@ module Backup | @@ -45,6 +56,17 @@ module Backup | ||
45 | else | 56 | else |
46 | puts "[FAILED]".red | 57 | puts "[FAILED]".red |
47 | end | 58 | end |
59 | + | ||
60 | + wiki = GollumWiki.new(project) | ||
61 | + | ||
62 | + if File.exists?(path_to_bundle(wiki)) | ||
63 | + print " * #{wiki.path_with_namespace} ... " | ||
64 | + if system("git clone --bare #{path_to_bundle(wiki)} #{path_to_repo(wiki)} > /dev/null 2>&1") | ||
65 | + puts " [DONE]".green | ||
66 | + else | ||
67 | + puts " [FAILED]".red | ||
68 | + end | ||
69 | + end | ||
48 | end | 70 | end |
49 | end | 71 | end |
50 | 72 |