2021-09-04 01:27:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
module PipelineCreation
|
|
|
|
class StartPipelineService
|
|
|
|
attr_reader :pipeline
|
|
|
|
|
|
|
|
def initialize(pipeline)
|
|
|
|
@pipeline = pipeline
|
|
|
|
end
|
|
|
|
|
|
|
|
def execute
|
2022-07-16 23:28:13 +05:30
|
|
|
##
|
|
|
|
# Create a persistent ref for the pipeline.
|
|
|
|
# The pipeline ref is fetched in the jobs and deleted when the pipeline transitions to a finished state.
|
|
|
|
pipeline.ensure_persistent_ref
|
|
|
|
|
2021-09-04 01:27:46 +05:30
|
|
|
Ci::ProcessPipelineService.new(pipeline).execute
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
::Ci::PipelineCreation::StartPipelineService.prepend_mod_with('Ci::PipelineCreation::StartPipelineService')
|