Class: Gitlab::Ci::Config::Entry::Image

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/image.rb

Overview

Entry that represents a Docker image.

Constant Summary collapse

ALLOWED_KEYS =
%i[name entrypoint 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

#entrypointObject


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

def entrypoint
  value[:entrypoint]
end

#nameObject


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

def name
  value[:name]
end

#skip_config_hash_validation?Boolean

Returns:

  • (Boolean)

50
51
52
# File 'lib/gitlab/ci/config/entry/image.rb', line 50

def skip_config_hash_validation?
  true
end

#valueObject


39
40
41
42
43
44
# File 'lib/gitlab/ci/config/entry/image.rb', line 39

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

  {}
end

#with_image_ports?Boolean

Returns:

  • (Boolean)

46
47
48
# File 'lib/gitlab/ci/config/entry/image.rb', line 46

def with_image_ports?
  opt(:with_image_ports)
end