25 lines
543 B
Ruby
25 lines
543 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Gitlab
|
|
module Ci
|
|
module Pipeline
|
|
module Chain
|
|
class EnsureEnvironments < Chain::Base
|
|
def perform!
|
|
pipeline.stages.map(&:statuses).flatten.each(&method(:ensure_environment))
|
|
end
|
|
|
|
def break?
|
|
false
|
|
end
|
|
|
|
private
|
|
|
|
def ensure_environment(build)
|
|
::Environments::CreateForBuildService.new.execute(build, merge_request: @command.merge_request)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|