diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-04-03 19:47:33 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-04-05 16:01:14 +0300 |
commit | 678620cce67cc283b19b75137f747f9415aaf942 (patch) | |
tree | 650b53c790087b88ce40f79c7c66cef6994c25b4 /app/models | |
parent | 9b1677b2deeec1faf0dd1d60a2b0c47e80b58433 (diff) |
Add `direct_upload` setting for artifacts
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/job_artifact.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb index df57b4f65e3..fbb95fe16df 100644 --- a/app/models/ci/job_artifact.rb +++ b/app/models/ci/job_artifact.rb @@ -7,6 +7,7 @@ module Ci belongs_to :project belongs_to :job, class_name: "Ci::Build", foreign_key: :job_id + before_save :update_file_store before_save :set_size, if: :file_changed? scope :with_files_stored_locally, -> { where(file_store: [nil, ::JobArtifactUploader::Store::LOCAL]) } @@ -21,6 +22,10 @@ module Ci trace: 3 } + def update_file_store + self.file_store = file.object_store + end + def self.artifacts_size_for(project) self.where(project: project).sum(:size) end |