Class: Gitlab::Ci::Config::Entry::Cache

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

Defined Under Namespace

Classes: UnknownStrategy

Constant Summary collapse

ALLOWED_KEYS =
%i[key untracked paths when policy unprotect fallback_keys].freeze
ALLOWED_POLICY =
/pull-push|push|pull|\$\w{1,255}*/
DEFAULT_POLICY =
'pull-push'
ALLOWED_WHEN =
%w[on_success on_failure always].freeze
DEFAULT_WHEN =
'on_success'
DEFAULT_FALLBACK_KEYS =
[].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, #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

#valueObject



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/gitlab/ci/config/entry/cache.rb', line 53

def value
  result = super

  result[:key] = key_value
  result[:unprotect] = unprotect || false
  result[:policy] = policy || DEFAULT_POLICY
  # Use self.when to avoid conflict with reserved word
  result[:when] = self.when || DEFAULT_WHEN
  result[:fallback_keys] = fallback_keys || DEFAULT_FALLBACK_KEYS

  result
end