blob: 204c7725214756e53084a01586455fd530f79142 (
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
30
31
32
33
34
35
36
37
38
39
40
41
|
# frozen_string_literal: true
module Gitlab
module Ci
module Pipeline
module Chain
class Sequence
def initialize(pipeline, command, sequence)
@pipeline = pipeline
@command = command
@sequence = sequence
@completed = []
@start = Time.now
end
def build!
@sequence.each do |chain|
step = chain.new(@pipeline, @command)
step.perform!
break if step.break?
@completed.push(step)
end
@pipeline.tap do
yield @pipeline, self if block_given?
@command.observe_creation_duration(Time.now - @start)
@command.observe_pipeline_size(@pipeline)
end
end
def complete?
@completed.size == @sequence.size
end
end
end
end
end
end
|