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

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

Overview

Entry that represents a configuration of Docker service.

TODO: remove duplication with Image superclass by defining a common Imageable concern. gitlab.com/gitlab-org/gitlab/issues/208774

Constant Summary collapse

ALLOWED_KEYS =
%i[name entrypoint command alias ports].freeze

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

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

Instance Attribute Summary

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

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

Instance Method Summary collapse

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

#compose!, #entry_create!

Methods included from Gitlab::Config::Entry::Validatable

#compose!, #errors, included, #validate, #validator

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

#[], #add_warning, #ancestors, 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


37
38
39
# File 'lib/gitlab/ci/config/entry/service.rb', line 37

def alias
  value[:alias]
end

#commandObject


41
42
43
# File 'lib/gitlab/ci/config/entry/service.rb', line 41

def command
  value[:command]
end

#entrypointObject


49
50
51
# File 'lib/gitlab/ci/config/entry/service.rb', line 49

def entrypoint
  value[:entrypoint]
end

#nameObject


45
46
47
# File 'lib/gitlab/ci/config/entry/service.rb', line 45

def name
  value[:name]
end

#skip_config_hash_validation?Boolean

Returns:

  • (Boolean)

64
65
66
# File 'lib/gitlab/ci/config/entry/service.rb', line 64

def skip_config_hash_validation?
  true
end

#valueObject


53
54
55
56
57
58
# File 'lib/gitlab/ci/config/entry/service.rb', line 53

def value
  return { name: @config } if string?
  return @config if hash?

  {}
end

#with_image_ports?Boolean

Returns:

  • (Boolean)

60
61
62
# File 'lib/gitlab/ci/config/entry/service.rb', line 60

def with_image_ports?
  opt(:with_image_ports)
end