BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
ad25ef1f
Commit
ad25ef1f
authored
Jan 15, 2018
by
Balasankar "Balu" C
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
List available backups for restore
parent
377d5c9e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
manager.rb
lib/backup/manager.rb
+6
-1
manager_spec.rb
spec/lib/backup/manager_spec.rb
+7
-0
No files found.
lib/backup/manager.rb
View file @
ad25ef1f
...
...
@@ -108,7 +108,12 @@ module Backup
$progress
.
puts
"Please make sure that file name ends with
#{
FILE_NAME_SUFFIX
}
"
exit
1
elsif
backup_file_list
.
many?
&&
ENV
[
"BACKUP"
].
nil?
$progress
.
puts
'Found more than one backup, please specify which one you want to restore:'
$progress
.
puts
'Found more than one backup:'
# print list of available backups
backup_file_list
.
each
do
|
item
|
$progress
.
puts
" "
+
item
.
gsub
(
"
#{
FILE_NAME_SUFFIX
}
"
,
""
)
end
$progress
.
puts
'Please specify which one you want to restore:'
$progress
.
puts
'rake gitlab:backup:restore BACKUP=timestamp_of_backup'
exit
1
end
...
...
spec/lib/backup/manager_spec.rb
View file @
ad25ef1f
...
...
@@ -194,6 +194,13 @@ describe Backup::Manager do
)
end
it
'prints the list of available backups'
do
expect
(
progress
).
to
have_received
(
:puts
)
.
with
(
a_string_matching
(
'1451606400_2016_01_01_1.2.3'
))
expect
(
progress
).
to
have_received
(
:puts
)
.
with
(
a_string_matching
(
'1451520000_2015_12_31'
))
end
it
'fails the operation and prints an error'
do
expect
{
subject
.
unpack
}.
to
raise_error
SystemExit
expect
(
progress
).
to
have_received
(
:puts
)
...
...
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