Class: Gitlab::Ci::Pipeline::Chain::Sequence

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/ci/pipeline/chain/sequence.rb

Instance Method Summary collapse

Constructor Details

#initialize(pipeline, command, sequence) ⇒ Sequence

Returns a new instance of Sequence.


8
9
10
11
12
13
# File 'lib/gitlab/ci/pipeline/chain/sequence.rb', line 8

def initialize(pipeline, command, sequence)
  @pipeline = pipeline
  @command = command
  @sequence = sequence
  @start = Time.now
end

Instance Method Details

#build!Object


15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/gitlab/ci/pipeline/chain/sequence.rb', line 15

def build!
  @sequence.each do |step_class|
    step = step_class.new(@pipeline, @command)

    step.perform!
    break if step.break?
  end

  @command.observe_creation_duration(Time.now - @start)
  @command.observe_pipeline_size(@pipeline)

  @pipeline
end