debian-mirror-gitlab/lib/gitlab/ci/pipeline/chain/ensure_resource_groups.rb
2022-04-04 11:22:00 +05:30

32 lines
772 B
Ruby

# frozen_string_literal: true
module Gitlab
module Ci
module Pipeline
module Chain
class EnsureResourceGroups < Chain::Base
def perform!
pipeline.stages.map(&:statuses).flatten.each(&method(:ensure_resource_group))
end
def break?
false
end
private
def ensure_resource_group(processable)
return unless processable.is_a?(::Ci::Processable)
key = processable.options.delete(:resource_group_key)
resource_group = ::Gitlab::Ci::Pipeline::Seed::Processable::ResourceGroup
.new(processable, key).to_resource
processable.resource_group = resource_group
end
end
end
end
end
end