提交 1756604f 编写于 作者: Z Zeger-Jan van de Weg 提交者: Kamil Trzcinski

JobArtifactsUploader does not inherrit from ArtifactsUploader

上级 c7d94575
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册