Class: Gitlab::Ci::Config::Entry::Artifacts

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

Overview

Entry that represents a configuration of job artifacts.

Constant Summary collapse

ALLOWED_WHEN =
%w[on_success on_failure always].freeze
ALLOWED_KEYS =
%i[name untracked paths reports when expire_in expose_as exclude public].freeze
EXPOSE_AS_REGEX =
/\A\w[-\w ]*\z/
EXPOSE_AS_ERROR_MESSAGE =
"can contain only letters, digits, '-', '_' and spaces"

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 Gitlab::Config::Entry::Validatable

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

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

#expose_as_present?Boolean

Returns:

  • (Boolean)


55
56
57
58
59
60
61
62
# File 'lib/gitlab/ci/config/entry/artifacts.rb', line 55

def expose_as_present?
  # This duplicates the `validates :config, type: Hash` above,
  # but Validatable currently doesn't halt the validation
  # chain if it encounters a validation error.
  return false unless @config.is_a?(Hash)

  !@config[:expose_as].nil?
end

#valueObject



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

def value
  @config[:reports] = reports_value if @config.key?(:reports)
  @config
end