2018-10-26 00:12:43 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-14 04:52:25 -04:00
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Build
|
|
|
|
module Policy
|
|
|
|
##
|
2017-09-18 08:29:43 -04:00
|
|
|
# Abstract class that defines an interface of job policy
|
2017-09-14 04:52:25 -04:00
|
|
|
# specification.
|
|
|
|
#
|
|
|
|
# Used for job's only/except policy configuration.
|
|
|
|
#
|
|
|
|
class Specification
|
|
|
|
UnknownPolicyError = Class.new(StandardError)
|
|
|
|
|
|
|
|
def initialize(spec)
|
|
|
|
@spec = spec
|
|
|
|
end
|
|
|
|
|
2018-03-23 08:56:16 -04:00
|
|
|
def satisfied_by?(pipeline, seed = nil)
|
2017-09-14 04:52:25 -04:00
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|