2016-06-24 04:13:55 -04:00
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
class Config
|
2016-11-14 04:31:45 -05:00
|
|
|
module Entry
|
2016-06-24 04:13:55 -04:00
|
|
|
##
|
|
|
|
# Entry that represents a cache configuration
|
|
|
|
#
|
2016-11-14 04:31:45 -05:00
|
|
|
class Cache < Node
|
2016-06-24 04:13:55 -04:00
|
|
|
include Configurable
|
|
|
|
|
2017-02-21 18:32:18 -05:00
|
|
|
ALLOWED_KEYS = %i[key untracked paths].freeze
|
2016-07-29 06:30:38 -04:00
|
|
|
|
2016-07-18 09:38:06 -04:00
|
|
|
validations do
|
2016-07-29 06:30:38 -04:00
|
|
|
validates :config, allowed_keys: ALLOWED_KEYS
|
2016-07-18 09:38:06 -04:00
|
|
|
end
|
|
|
|
|
2016-11-14 04:51:56 -05:00
|
|
|
entry :key, Entry::Key,
|
2016-06-27 08:12:47 -04:00
|
|
|
description: 'Cache key used to define a cache affinity.'
|
|
|
|
|
2016-11-14 04:51:56 -05:00
|
|
|
entry :untracked, Entry::Boolean,
|
2016-06-27 08:12:47 -04:00
|
|
|
description: 'Cache all untracked files.'
|
|
|
|
|
2016-11-14 04:51:56 -05:00
|
|
|
entry :paths, Entry::Paths,
|
2016-06-27 08:12:47 -04:00
|
|
|
description: 'Specify which paths should be cached across builds.'
|
2016-06-24 04:13:55 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|