summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/config/entry/docker_image.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/config/entry/docker_image.rb')
-rw-r--r--lib/gitlab/ci/config/entry/docker_image.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/gitlab/ci/config/entry/docker_image.rb b/lib/gitlab/ci/config/entry/docker_image.rb
new file mode 100644
index 00000000000..1170e129bc0
--- /dev/null
+++ b/lib/gitlab/ci/config/entry/docker_image.rb
@@ -0,0 +1,31 @@
+module Gitlab
+ module Ci
+ class Config
+ module Entry
+ module DockerImage
+ def hash?
+ @config.is_a?(Hash)
+ end
+
+ def string?
+ @config.is_a?(String)
+ end
+
+ def name
+ value[:name]
+ end
+
+ def entrypoint
+ value[:entrypoint]
+ end
+
+ def value
+ return { name: @config } if string?
+ return @config if hash?
+ {}
+ end
+ end
+ end
+ end
+ end
+end