summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2017-06-05 16:15:09 +0200
committerTomasz Maczukin <tomasz@maczukin.pl>2017-06-12 12:58:35 +0200
commitc70e9f2ed107ac3d0189a803eae6e7e7917f6224 (patch)
tree5006c53ceee82297827a0c18285f728d8e1cdc6f /lib
parent8c6e2bada222745c9994da42f21bad2ab43b9351 (diff)
downloadgitlab-ce-c70e9f2ed107ac3d0189a803eae6e7e7917f6224.tar.gz
Send new configuration options with job's payload
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb8
-rw-r--r--lib/gitlab/ci/build/image.rb11
2 files changed, 15 insertions, 4 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index a836df3dc81..8d3d34b844d 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -804,7 +804,11 @@ module API
end
class Image < Grape::Entity
- expose :name
+ expose :name, :entrypoint
+ end
+
+ class ServiceImage < Image
+ expose :alias, :command
end
class Artifacts < Grape::Entity
@@ -848,7 +852,7 @@ module API
expose :variables
expose :steps, using: Step
expose :image, using: Image
- expose :services, using: Image
+ expose :services, using: ServiceImage
expose :artifacts, using: Artifacts
expose :cache, using: Cache
expose :credentials, using: Credentials
diff --git a/lib/gitlab/ci/build/image.rb b/lib/gitlab/ci/build/image.rb
index c62aeb60fa9..b88b2e36d53 100644
--- a/lib/gitlab/ci/build/image.rb
+++ b/lib/gitlab/ci/build/image.rb
@@ -2,7 +2,7 @@ module Gitlab
module Ci
module Build
class Image
- attr_reader :name
+ attr_reader :alias, :command, :entrypoint, :name
class << self
def from_image(job)
@@ -21,7 +21,14 @@ module Gitlab
end
def initialize(image)
- @name = image
+ if image.is_a?(String)
+ @name = image
+ elsif image.is_a?(Hash)
+ @alias = image[:alias]
+ @command = image[:command]
+ @entrypoint = image[:entrypoint]
+ @name = image[:name]
+ end
end
def valid?