summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2017-06-12 13:35:32 +0200
committerTomasz Maczukin <tomasz@maczukin.pl>2017-06-12 14:27:17 +0200
commit645c8651410961e61cf220e859f2faddaf66b5e7 (patch)
tree16e8f8a95cc6f2634f999acffafe4a917fa354c7
parent3e75fd6c5b2ed31a4a634d11d3f88d01dfa988a8 (diff)
downloadgitlab-ce-645c8651410961e61cf220e859f2faddaf66b5e7.tar.gz
Remove Gitlab::Ci::Config::Entry::DockerImage
-rw-r--r--lib/gitlab/ci/config/entry/docker_image.rb31
-rw-r--r--lib/gitlab/ci/config/entry/image.rb23
-rw-r--r--lib/gitlab/ci/config/entry/service.rb3
3 files changed, 23 insertions, 34 deletions
diff --git a/lib/gitlab/ci/config/entry/docker_image.rb b/lib/gitlab/ci/config/entry/docker_image.rb
deleted file mode 100644
index 1170e129bc0..00000000000
--- a/lib/gitlab/ci/config/entry/docker_image.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-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
diff --git a/lib/gitlab/ci/config/entry/image.rb b/lib/gitlab/ci/config/entry/image.rb
index 10f35a2dbc1..897dcff8012 100644
--- a/lib/gitlab/ci/config/entry/image.rb
+++ b/lib/gitlab/ci/config/entry/image.rb
@@ -7,7 +7,6 @@ module Gitlab
#
class Image < Node
include Validatable
- include DockerImage
ALLOWED_KEYS = %i[name entrypoint].freeze
@@ -18,6 +17,28 @@ module Gitlab
validates :name, type: String, presence: true
validates :entrypoint, type: String, allow_nil: true
end
+
+ 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
diff --git a/lib/gitlab/ci/config/entry/service.rb b/lib/gitlab/ci/config/entry/service.rb
index fd0aec23803..b52faf48b58 100644
--- a/lib/gitlab/ci/config/entry/service.rb
+++ b/lib/gitlab/ci/config/entry/service.rb
@@ -5,9 +5,8 @@ module Gitlab
##
# Entry that represents a configuration of Docker service.
#
- class Service < Node
+ class Service < Image
include Validatable
- include DockerImage
ALLOWED_KEYS = %i[name entrypoint command alias].freeze