36 lines
868 B
Ruby
36 lines
868 B
Ruby
|
module Gitlab
|
||
|
module Ci
|
||
|
class Config
|
||
|
module Entry
|
||
|
##
|
||
|
# Entry that represents a configuration of Docker service.
|
||
|
#
|
||
|
class Service < Node
|
||
|
include Validatable
|
||
|
include DockerImage
|
||
|
|
||
|
ALLOWED_KEYS = %i[name entrypoint command alias].freeze
|
||
|
|
||
|
validations do
|
||
|
validates :config, hash_or_string: true
|
||
|
validates :config, allowed_keys: ALLOWED_KEYS
|
||
|
|
||
|
validates :name, type: String, presence: true
|
||
|
validates :entrypoint, type: String, allow_nil: true
|
||
|
validates :command, type: String, allow_nil: true
|
||
|
validates :alias, type: String, allow_nil: true
|
||
|
end
|
||
|
|
||
|
def alias
|
||
|
value[:alias]
|
||
|
end
|
||
|
|
||
|
def command
|
||
|
value[:command]
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|