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
Jérome Perrin
gitlab-ce
Commits
e7896447
Commit
e7896447
authored
Oct 06, 2015
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep old path: db/database.sql.gz
Documentation elsewhere refers to this internal path, let's keep it.
parent
7b71727c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
lib/backup/database.rb
lib/backup/database.rb
+2
-1
lib/backup/manager.rb
lib/backup/manager.rb
+2
-2
No files found.
lib/backup/database.rb
View file @
e7896447
...
@@ -6,10 +6,11 @@ module Backup
...
@@ -6,10 +6,11 @@ module Backup
def
initialize
def
initialize
@config
=
YAML
.
load_file
(
File
.
join
(
Rails
.
root
,
'config'
,
'database.yml'
))[
Rails
.
env
]
@config
=
YAML
.
load_file
(
File
.
join
(
Rails
.
root
,
'config'
,
'database.yml'
))[
Rails
.
env
]
@db_file_name
=
File
.
join
(
Gitlab
.
config
.
backup
.
path
,
'database.sql.gz'
)
@db_file_name
=
File
.
join
(
Gitlab
.
config
.
backup
.
path
,
'd
b'
,
'd
atabase.sql.gz'
)
end
end
def
dump
def
dump
FileUtils
.
mkdir_p
(
File
.
dirname
(
db_file_name
))
FileUtils
.
rm_f
(
db_file_name
)
FileUtils
.
rm_f
(
db_file_name
)
compress_rd
,
compress_wr
=
IO
.
pipe
compress_rd
,
compress_wr
=
IO
.
pipe
compress_pid
=
spawn
(
*
%W(gzip -1 -c)
,
in:
compress_rd
,
out:
[
db_file_name
,
'w'
,
0600
])
compress_pid
=
spawn
(
*
%W(gzip -1 -c)
,
in:
compress_rd
,
out:
[
db_file_name
,
'w'
,
0600
])
...
...
lib/backup/manager.rb
View file @
e7896447
...
@@ -150,11 +150,11 @@ module Backup
...
@@ -150,11 +150,11 @@ module Backup
private
private
def
backup_contents
def
backup_contents
folders_to_backup
+
[
"
database.sql.gz"
,
"
uploads.tar.gz"
,
"builds.tar.gz"
,
"backup_information.yml"
]
folders_to_backup
+
[
"uploads.tar.gz"
,
"builds.tar.gz"
,
"backup_information.yml"
]
end
end
def
folders_to_backup
def
folders_to_backup
folders
=
%w{repositories}
folders
=
%w{repositories
db
}
if
ENV
[
"SKIP"
]
if
ENV
[
"SKIP"
]
return
folders
.
reject
{
|
folder
|
ENV
[
"SKIP"
].
include?
(
folder
)
}
return
folders
.
reject
{
|
folder
|
ENV
[
"SKIP"
].
include?
(
folder
)
}
...
...
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