summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-11-23 18:51:20 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2017-12-03 12:04:49 +0100
commit38c61ab6df15fbd1eab22a8dff8da01b17c075f3 (patch)
treec0df50ea346d5ab5f9b21951b9fc746869a44612 /app/uploaders
parent871de0f18581bb03fed5c0d800f8183598a0195f (diff)
downloadgitlab-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.rb20
-rw-r--r--app/uploaders/legacy_artifact_uploader.rb2
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