diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-11-23 18:51:20 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-03 12:04:49 +0100 |
commit | 38c61ab6df15fbd1eab22a8dff8da01b17c075f3 (patch) | |
tree | c0df50ea346d5ab5f9b21951b9fc746869a44612 /app/uploaders | |
parent | 871de0f18581bb03fed5c0d800f8183598a0195f (diff) | |
download | gitlab-ce-38c61ab6df15fbd1eab22a8dff8da01b17c075f3.tar.gz |
Fix specs failures, and use factory with `:ci_job_artifact, :archive`
Diffstat (limited to 'app/uploaders')
-rw-r--r-- | app/uploaders/job_artifact_uploader.rb | 20 | ||||
-rw-r--r-- | app/uploaders/legacy_artifact_uploader.rb | 2 |
2 files changed, 19 insertions, 3 deletions
diff --git a/app/uploaders/job_artifact_uploader.rb b/app/uploaders/job_artifact_uploader.rb index d54411e198f..15dfb5a5763 100644 --- a/app/uploaders/job_artifact_uploader.rb +++ b/app/uploaders/job_artifact_uploader.rb @@ -1,12 +1,12 @@ class JobArtifactUploader < GitlabUploader storage :file - def self.local_artifacts_store + def self.local_store_path Gitlab.config.artifacts.path end def self.artifacts_upload_path - File.join(self.local_artifacts_store, 'tmp/uploads/') + File.join(self.local_store_path, 'tmp/uploads/') end def size @@ -15,8 +15,24 @@ class JobArtifactUploader < GitlabUploader model.size end + def store_dir + default_local_path + end + + def cache_dir + File.join(self.class.local_store_path, 'tmp/cache') + end + + def work_dir + File.join(self.class.local_store_path, 'tmp/work') + end + private + def default_local_path + File.join(self.class.local_store_path, default_path) + end + def default_path creation_date = model.created_at.utc.strftime('%Y_%m_%d') diff --git a/app/uploaders/legacy_artifact_uploader.rb b/app/uploaders/legacy_artifact_uploader.rb index 0c23e05b680..4f7f8a63108 100644 --- a/app/uploaders/legacy_artifact_uploader.rb +++ b/app/uploaders/legacy_artifact_uploader.rb @@ -6,7 +6,7 @@ class LegacyArtifactUploader < GitlabUploader end def self.artifacts_upload_path - File.join(self.local_artifacts_store, 'tmp/uploads/') + File.join(self.local_store_path, 'tmp/uploads/') end def store_dir |