2019-03-02 22:35:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
##
|
|
|
|
# This module implements methods that need to be implemented by CI/CD
|
|
|
|
# entities that are supposed to go through pipeline processing
|
|
|
|
# services.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
module Processable
|
2019-12-26 22:10:19 +05:30
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
has_many :needs, class_name: 'Ci::BuildNeed', foreign_key: :build_id, inverse_of: :build
|
|
|
|
|
|
|
|
accepts_nested_attributes_for :needs
|
2020-01-01 13:55:28 +05:30
|
|
|
|
|
|
|
scope :preload_needs, -> { preload(:needs) }
|
2019-12-26 22:10:19 +05:30
|
|
|
end
|
|
|
|
|
2019-03-02 22:35:43 +05:30
|
|
|
def schedulable?
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def action?
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def when
|
|
|
|
read_attribute(:when) || 'on_success'
|
|
|
|
end
|
|
|
|
|
|
|
|
def expanded_environment_name
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
2019-07-07 11:18:12 +05:30
|
|
|
|
|
|
|
def scoped_variables_hash
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
2019-03-02 22:35:43 +05:30
|
|
|
end
|
|
|
|
end
|