diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-12-04 13:56:32 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-12-04 14:02:56 +0100 |
commit | 9737f582a10ff43cac0ee47f20f200ffd744b93a (patch) | |
tree | 36dfedb4512577ffa6f7c7cb8be1b7f81c414f50 | |
parent | 87b33961d768d74b23df9fba398e0d59aeb511d3 (diff) | |
download | gitlab-ce-backstage/gb/improve-pipeline-chain-reduce-side-effects.tar.gz |
Reduce pipeline chain life span to minimize side effectsbackstage/gb/improve-pipeline-chain-reduce-side-effects
-rw-r--r-- | lib/gitlab/ci/pipeline/chain/sequence.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/gitlab/ci/pipeline/chain/sequence.rb b/lib/gitlab/ci/pipeline/chain/sequence.rb index 015f2988327..e24630656d3 100644 --- a/lib/gitlab/ci/pipeline/chain/sequence.rb +++ b/lib/gitlab/ci/pipeline/chain/sequence.rb @@ -5,20 +5,19 @@ module Gitlab class Sequence def initialize(pipeline, command, sequence) @pipeline = pipeline + @command = command + @sequence = sequence @completed = [] - - @sequence = sequence.map do |chain| - chain.new(pipeline, command) - end end def build! - @sequence.each do |step| - step.perform! + @sequence.each do |chain| + step = chain.new(@pipeline, @command) + step.perform! break if step.break? - @completed << step + @completed.push(step) end @pipeline.tap do |