diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-04-05 23:59:40 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-04-05 23:59:40 +0300 |
commit | dd271e246001a06609592eef109d154291305d32 (patch) | |
tree | 279ef8877a1a7507d26c042810410f6362114e35 /app/models | |
parent | e9e800f5239f5b45984d49615bbc67e823a117ab (diff) | |
parent | 678620cce67cc283b19b75137f747f9415aaf942 (diff) |
Merge branch 'direct-upload-of-artifacts' into 'master'
Direct upload of artifacts
See merge request gitlab-org/gitlab-ce!18160
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 |