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
Boxiang Sun
gitlab-ce
Commits
1756604f
Commit
1756604f
authored
Nov 07, 2017
by
Zeger-Jan van de Weg
Committed by
Kamil Trzcinski
Dec 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JobArtifactsUploader does not inherrit from ArtifactsUploader
parent
c7d94575
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
app/uploaders/job_artifact_uploader.rb
app/uploaders/job_artifact_uploader.rb
+20
-6
No files found.
app/uploaders/job_artifact_uploader.rb
View file @
1756604f
class
JobArtifactUploader
<
ArtifactUploader
class
JobArtifactUploader
<
GitlabUploader
storage
:file
def
self
.
local_artifacts_store
Gitlab
.
config
.
artifacts
.
path
end
def
self
.
artifacts_upload_path
File
.
join
(
self
.
local_artifacts_store
,
'tmp/uploads/'
)
end
def
initialize
(
artifact
,
_field
)
@artifact
=
artifact
end
...
...
@@ -9,16 +19,20 @@ class JobArtifactUploader < ArtifactUploader
@artifact
.
size
end
private
def
disk_hash
@disk_hash
||=
Digest
::
SHA2
.
hexdigest
(
@artifact
.
project_id
.
to_s
)
def
store_dir
File
.
join
(
self
.
class
.
local_artifacts_store
,
default_path
)
end
private
def
default_path
creation_date
=
@artifact
.
created_at
.
utc
.
strftime
(
'%Y_%m_%d'
)
File
.
join
(
disk_hash
[
0
..
1
],
disk_hash
[
2
..
3
],
disk_hash
,
creation_date
,
@artifact
.
ci_job_id
.
to_s
,
@artifact
.
id
.
to_s
)
creation_date
,
@artifact
.
job_id
.
to_s
,
@artifact
.
id
.
to_s
)
end
def
disk_hash
@disk_hash
||=
Digest
::
SHA2
.
hexdigest
(
@artifact
.
project_id
.
to_s
)
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