Class: Ci::PipelineCreation::StartPipelineService

Inherits:
Object
  • Object
show all
Defined in:
app/services/ci/pipeline_creation/start_pipeline_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pipeline) ⇒ StartPipelineService

Returns a new instance of StartPipelineService.



8
9
10
# File 'app/services/ci/pipeline_creation/start_pipeline_service.rb', line 8

def initialize(pipeline)
  @pipeline = pipeline
end

Instance Attribute Details

#pipelineObject (readonly)

Returns the value of attribute pipeline.



6
7
8
# File 'app/services/ci/pipeline_creation/start_pipeline_service.rb', line 6

def pipeline
  @pipeline
end

Instance Method Details

#executeObject



12
13
14
15
16
17
18
19
# File 'app/services/ci/pipeline_creation/start_pipeline_service.rb', line 12

def execute
  ##
  # 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

  Ci::ProcessPipelineService.new(pipeline).execute
end