Skip to content
Snippets Groups Projects
Unverified Commit 9e4226cd authored by Z.J. van de Weg's avatar Z.J. van de Weg Committed by Kamil Trzcinski
Browse files

Allow object store for Job Artifacts

Given that storage of artifacts on disk is not the most scalable
solution, object storage, e.g. S3 should be supported. The change
requires a new key in the `gitlab.yml`, `object_store` under artifacts.
If this is set to true, fog will be used for storage instead the local
FS.

If credentials are incorrect, we don't catch this yet.
parent 025b04f3
No related branches found
No related tags found
No related merge requests found
class ArtifactUploader < GitlabUploader
storage :file
storage Gitlab.config.artifacts.object_store ? :fog : :file
 
attr_accessor :build, :field
attr_accessor :job, :field
 
def self.artifacts_path
Gitlab.config.artifacts.path
Loading
Loading
@@ -15,16 +15,16 @@ class ArtifactUploader < GitlabUploader
File.join(self.artifacts_path, 'tmp/cache/')
end
 
def initialize(build, field)
@build, @field = build, field
def initialize(job, field)
@job, @field = job, field
end
 
def store_dir
File.join(self.class.artifacts_path, @build.artifacts_path)
File.join(self.class.artifacts_path, job.artifacts_path)
end
 
def cache_dir
File.join(self.class.artifacts_cache_path, @build.artifacts_path)
File.join(self.class.artifacts_cache_path, job.artifacts_path)
end
 
def filename
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment