From 25df666156279e5b392b429519b4f4ba01eefaac Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Tue, 19 Sep 2017 09:14:06 +0200 Subject: Create Ci::Artifacts To allow jobs/builds to have multiple artifacts, and to start seperating concerns from Ci::Build a new model is created: Ci::Artifact. Changes include the updating of the ArtifactUploader to adapt to a slightly different interface. The uploader expects to be initialized with a `Ci::Build`. Futher a migration with the minimal fields, the needed foreign keys and an index. Last, the way this works is by prepending a module to Ci::Build so we can basically override behaviour but if needed use `super` to get the original behaviour. --- app/uploaders/artifact_uploader.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/uploaders') diff --git a/app/uploaders/artifact_uploader.rb b/app/uploaders/artifact_uploader.rb index 14addb6cf14..8ac0e2fe5a2 100644 --- a/app/uploaders/artifact_uploader.rb +++ b/app/uploaders/artifact_uploader.rb @@ -12,6 +12,10 @@ class ArtifactUploader < GitlabUploader end def initialize(job, field) + # Temporairy conditional, needed to move artifacts to their own table, + # but keeping compat with Ci::Build for the time being + job = job.build if job.respond_to?(:build) + @job, @field = job, field end -- cgit v1.2.1