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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
5f4fea17
Commit
5f4fea17
authored
Jun 03, 2013
by
Angus MacArthur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correction to restore expected current directory
parent
9c82bca5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
lib/tasks/gitlab/backup.rake
lib/tasks/gitlab/backup.rake
+14
-9
No files found.
lib/tasks/gitlab/backup.rake
View file @
5f4fea17
...
@@ -91,16 +91,21 @@ namespace :gitlab do
...
@@ -91,16 +91,21 @@ namespace :gitlab do
ENV
[
"VERSION"
]
=
"
#{
settings
[
:db_version
]
}
"
if
settings
[
:db_version
].
to_i
>
0
ENV
[
"VERSION"
]
=
"
#{
settings
[
:db_version
]
}
"
if
settings
[
:db_version
].
to_i
>
0
# backups directory is not always sub of Rails root and able to execute the git rev-parse below
# backups directory is not always sub of Rails root and able to execute the git rev-parse below
begin
Dir
.
chdir
(
Rails
.
root
)
Dir
.
chdir
(
Rails
.
root
)
# restoring mismatching backups can lead to unexpected problems
# restoring mismatching backups can lead to unexpected problems
if
settings
[
:gitlab_version
]
!=
%x{git rev-parse HEAD}
.
gsub
(
/\n/
,
""
)
if
settings
[
:gitlab_version
]
!=
%x{git rev-parse HEAD}
.
gsub
(
/\n/
,
""
)
puts
"GitLab version mismatch:"
.
red
puts
"GitLab version mismatch:"
.
red
puts
" Your current HEAD differs from the HEAD in the backup!"
.
red
puts
" Your current HEAD differs from the HEAD in the backup!"
.
red
puts
" Please switch to the following revision and try again:"
.
red
puts
" Please switch to the following revision and try again:"
.
red
puts
" revision:
#{
settings
[
:gitlab_version
]
}
"
.
red
puts
" revision:
#{
settings
[
:gitlab_version
]
}
"
.
red
exit
1
exit
1
end
end
ensure
# chdir back to original intended dir
Dir
.
chdir
(
Gitlab
.
config
.
backup
.
path
)
end
Rake
::
Task
[
"gitlab:backup:db:restore"
].
invoke
Rake
::
Task
[
"gitlab:backup:db:restore"
].
invoke
Rake
::
Task
[
"gitlab:backup:repo:restore"
].
invoke
Rake
::
Task
[
"gitlab:backup:repo:restore"
].
invoke
...
...
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