Class: Gitlab::Ci::Config::Entry::Service

Inherits:
Gitlab::Config::Entry::Node show all
Includes:
Imageable
Defined in:
lib/gitlab/ci/config/entry/service.rb

Overview

Entry that represents a configuration of Docker service.

Constant Summary collapse

ALLOWED_KEYS =
%i[command alias variables].freeze

Constants included from Imageable

Imageable::EXECUTOR_OPTS_KEYS, Imageable::IMAGEABLE_ALLOWED_KEYS

Constants inherited from Gitlab::Config::Entry::Node

Gitlab::Config::Entry::Node::InvalidError

Instance Attribute Summary

Attributes inherited from Gitlab::Config::Entry::Node

#config, #default, #deprecation, #description, #key, #metadata, #parent

Instance Method Summary collapse

Methods included from Imageable

#entrypoint, #executor_opts, #name, #skip_config_hash_validation?, #with_image_ports?

Methods included from Gitlab::Config::Entry::Configurable

#compose!, #entry_create!, #skip_config_hash_validation?

Methods inherited from Gitlab::Config::Entry::Node

#[], #add_warning, #ancestors, #array?, aspects, #compose!, default, #descendants, #errors, #hash?, #initialize, #inspect, #integer?, #leaf?, #location, #opt, #relevant?, #specified?, #string?, #valid?, #warnings, with_aspect

Constructor Details

This class inherits a constructor from Gitlab::Config::Entry::Node

Instance Method Details

#aliasObject



31
32
33
# File 'lib/gitlab/ci/config/entry/service.rb', line 31

def alias
  value[:alias]
end

#commandObject



35
36
37
# File 'lib/gitlab/ci/config/entry/service.rb', line 35

def command
  command_value if command_defined?
end

#valueObject



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/gitlab/ci/config/entry/service.rb', line 39

def value
  if hash?
    super.merge(
      command: (command_value if command_defined?),
      alias: @config[:alias],
      variables: (variables_value if variables_defined?)
    ).compact
  else
    super
  end
end