Welcome to mirror list, hosted at ThFree Co, Russian Federation.

create_deployments.rb « chain « pipeline « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a8276d84b87bdaba43f661c97dfaff01c4d32d02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

module Gitlab
  module Ci
    module Pipeline
      module Chain
        class CreateDeployments < Chain::Base
          def perform!
            create_deployments!
          end

          def break?
            false
          end

          private

          def create_deployments!
            pipeline.stages.map(&:statuses).flatten.map(&method(:create_deployment))
          end

          def create_deployment(build)
            ::Deployments::CreateForBuildService.new.execute(build)
          end
        end
      end
    end
  end
end