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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/ci/initial_pipeline_process_worker.rb')
-rw-r--r--app/workers/ci/initial_pipeline_process_worker.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/workers/ci/initial_pipeline_process_worker.rb b/app/workers/ci/initial_pipeline_process_worker.rb
index 8d7a62e5b09..734755f176a 100644
--- a/app/workers/ci/initial_pipeline_process_worker.rb
+++ b/app/workers/ci/initial_pipeline_process_worker.rb
@@ -17,10 +17,22 @@ module Ci
def perform(pipeline_id)
Ci::Pipeline.find_by_id(pipeline_id).try do |pipeline|
+ create_deployments!(pipeline) if Feature.enabled?(:move_create_deployments_to_worker, pipeline.project)
+
Ci::PipelineCreation::StartPipelineService
.new(pipeline)
.execute
end
end
+
+ private
+
+ def create_deployments!(pipeline)
+ pipeline.stages.flat_map(&:statuses).each { |build| create_deployment(build) }
+ end
+
+ def create_deployment(build)
+ ::Deployments::CreateForBuildService.new.execute(build)
+ end
end
end