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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
69eaf332
Commit
69eaf332
authored
Aug 18, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix store credentials
parent
6b8d88d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
app/uploaders/object_store_uploader.rb
app/uploaders/object_store_uploader.rb
+10
-2
spec/support/stub_artifacts.rb
spec/support/stub_artifacts.rb
+1
-1
spec/uploaders/object_store_uploader_spec.rb
spec/uploaders/object_store_uploader_spec.rb
+2
-2
No files found.
app/uploaders/object_store_uploader.rb
View file @
69eaf332
...
...
@@ -20,6 +20,14 @@ class ObjectStoreUploader < CarrierWave::Uploader::Base
def
object_store_enabled?
object_store_options
&
.
enabled
end
def
object_store_credentials
@object_store_credentials
||=
object_store_options
&
.
connection
&
.
to_hash
&
.
deep_symbolize_keys
end
def
object_store_directory
object_store_options
&
.
remote_directory
end
end
attr_reader
:subject
,
:field
...
...
@@ -98,11 +106,11 @@ class ObjectStoreUploader < CarrierWave::Uploader::Base
end
def
fog_directory
self
.
class
.
object_store_
options
.
remote_
directory
self
.
class
.
object_store_directory
end
def
fog_credentials
self
.
class
.
object_store_
options
.
connection
self
.
class
.
object_store_
credentials
end
def
fog_public
...
...
spec/support/stub_artifacts.rb
View file @
69eaf332
...
...
@@ -7,7 +7,7 @@ module StubConfiguration
return
unless
enabled
::
Fog
::
Storage
.
new
(
Gitlab
.
config
.
artifacts
.
object_store
.
connection
).
tap
do
|
connection
|
::
Fog
::
Storage
.
new
(
ArtifactUploader
.
object_store_credentials
).
tap
do
|
connection
|
begin
connection
.
directories
.
create
(
key:
'artifacts'
)
rescue
Excon
::
Error
::
Conflict
...
...
spec/uploaders/object_store_uploader_spec.rb
View file @
69eaf332
...
...
@@ -239,7 +239,7 @@ describe ObjectStoreUploader do
end
describe
'#fog_credentials'
do
let
(
:connection
)
{
'connection'
}
let
(
:connection
)
{
Settingslogic
.
new
(
"provider"
=>
"AWS"
)
}
before
do
uploader_class
.
storage_options
double
(
...
...
@@ -248,7 +248,7 @@ describe ObjectStoreUploader do
subject
{
uploader
.
fog_credentials
}
it
{
is_expected
.
to
eq
(
connection
)
}
it
{
is_expected
.
to
eq
(
provider:
'AWS'
)
}
end
describe
'#fog_public'
do
...
...
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