debian-mirror-gitlab/lib/gitlab/ci/config/entry/cache.rb

36 lines
811 B
Ruby
Raw Normal View History

2016-08-24 12:49:21 +05:30
module Gitlab
module Ci
class Config
2017-08-17 22:00:37 +05:30
module Entry
2016-08-24 12:49:21 +05:30
##
# Entry that represents a cache configuration
#
2017-08-17 22:00:37 +05:30
class Cache < Node
2016-08-24 12:49:21 +05:30
include Configurable
2017-08-17 22:00:37 +05:30
ALLOWED_KEYS = %i[key untracked paths].freeze
2016-09-13 17:45:13 +05:30
validations do
validates :config, allowed_keys: ALLOWED_KEYS
end
2017-08-17 22:00:37 +05:30
entry :key, Entry::Key,
2016-08-24 12:49:21 +05:30
description: 'Cache key used to define a cache affinity.'
2017-08-17 22:00:37 +05:30
entry :untracked, Entry::Boolean,
2016-08-24 12:49:21 +05:30
description: 'Cache all untracked files.'
2017-08-17 22:00:37 +05:30
entry :paths, Entry::Paths,
2016-08-24 12:49:21 +05:30
description: 'Specify which paths should be cached across builds.'
2017-08-17 22:00:37 +05:30
helpers :key
def value
super.merge(key: key_value)
end
2016-08-24 12:49:21 +05:30
end
end
end
end
end