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
ad29681c
Commit
ad29681c
authored
Mar 18, 2019
by
Dominic Renner
Committed by
Dmitriy Zaporozhets
Mar 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced config access
Replaced Settings with Gitlab.config for uniformity
parent
2ff13241
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
lib/backup/uploads.rb
lib/backup/uploads.rb
+1
-1
spec/lib/backup/uploads_spec.rb
spec/lib/backup/uploads_spec.rb
+18
-0
spec/tasks/gitlab/backup_rake_spec.rb
spec/tasks/gitlab/backup_rake_spec.rb
+1
-3
No files found.
lib/backup/uploads.rb
View file @
ad29681c
...
@@ -9,7 +9,7 @@ module Backup
...
@@ -9,7 +9,7 @@ module Backup
def
initialize
(
progress
)
def
initialize
(
progress
)
@progress
=
progress
@progress
=
progress
super
(
'uploads'
,
Rails
.
root
.
join
(
'public/uploads'
))
super
(
'uploads'
,
File
.
join
(
Gitlab
.
config
.
uploads
.
storage_path
,
"uploads"
))
end
end
end
end
end
end
spec/lib/backup/uploads_spec.rb
0 → 100644
View file @
ad29681c
require
'spec_helper'
describe
Backup
::
Uploads
do
let
(
:progress
)
{
StringIO
.
new
}
subject
(
:backup
)
{
described_class
.
new
(
progress
)
}
describe
'#initialize'
do
it
'uses the correct upload dir'
do
Dir
.
mktmpdir
do
|
tmpdir
|
FileUtils
.
mkdir_p
(
"
#{
tmpdir
}
/uploads"
)
allow
(
Gitlab
.
config
.
uploads
).
to
receive
(
:storage_path
)
{
tmpdir
}
expect
(
backup
.
app_files_dir
).
to
eq
(
"
#{
tmpdir
}
/uploads"
)
end
end
end
end
spec/tasks/gitlab/backup_rake_spec.rb
View file @
ad29681c
...
@@ -21,9 +21,6 @@ describe 'gitlab:app namespace rake task' do
...
@@ -21,9 +21,6 @@ describe 'gitlab:app namespace rake task' do
# empty task as env is already loaded
# empty task as env is already loaded
Rake
::
Task
.
define_task
:environment
Rake
::
Task
.
define_task
:environment
# We need this directory to run `gitlab:backup:create` task
FileUtils
.
mkdir_p
(
'public/uploads'
)
end
end
before
do
before
do
...
@@ -38,6 +35,7 @@ describe 'gitlab:app namespace rake task' do
...
@@ -38,6 +35,7 @@ describe 'gitlab:app namespace rake task' do
end
end
def
run_rake_task
(
task_name
)
def
run_rake_task
(
task_name
)
FileUtils
.
mkdir_p
(
'tmp/tests/public/uploads'
)
Rake
::
Task
[
task_name
].
reenable
Rake
::
Task
[
task_name
].
reenable
Rake
.
application
.
invoke_task
task_name
Rake
.
application
.
invoke_task
task_name
end
end
...
...
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