summaryrefslogtreecommitdiff
path: root/app/models/ci/build.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/ci/build.rb')
-rw-r--r--app/models/ci/build.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index f2989eff22d..0c0bbb9d41d 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -508,6 +508,35 @@ module Ci
]
end
+ def steps
+ [
+ Gitlab::Ci::Build::Response::Step.from_commands(self),
+ Gitlab::Ci::Build::Response::Step.from_after_script(self)
+ ].compact
+ end
+
+ def image
+ image = Gitlab::Ci::Build::Response::Image.new(options[:image])
+ return unless image.valid?
+ image
+ end
+
+ def services
+ services = options[:services].map do |service|
+ Gitlab::Ci::Build::Response::Image.new(service)
+ end
+
+ services.select(&:valid?).compact
+ end
+
+ def artifacts
+ options[:artifacts]
+ end
+
+ def cache
+ options[:cache]
+ end
+
def credentials
Gitlab::Ci::Build::Credentials::Factory.new(self).create!
end