diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-06-02 12:16:11 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-06-02 12:16:11 +0200 |
commit | fe0b2f81c7c9680a11288e0cdffc3e80dc1e8d58 (patch) | |
tree | fd19bea3c1118cb7438f0d2476bad322ccb5c421 /lib/ci | |
parent | aa0d6b07b6a87459e75c69111643b9d6fe8a97c2 (diff) | |
download | gitlab-ce-fe0b2f81c7c9680a11288e0cdffc3e80dc1e8d58.tar.gz |
Refine implementation of pipeline stage seeds
Diffstat (limited to 'lib/ci')
-rw-r--r-- | lib/ci/gitlab_ci_yaml_processor.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 4b0e87a945b..22af2671b18 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -50,14 +50,17 @@ module Ci end end - def stage_seeds(ref:, tag: false, trigger: nil) - Gitlab::Ci::Stage::Seeds.new.tap do |seeds| - @stages.uniq.each do |stage| - builds = builds_for_stage_and_ref(stage, ref, tag, trigger) + def stage_seeds(pipeline) + trigger_request = pipeline.trigger_requests.first - seeds.append_stage(stage, builds) if builds.any? - end + seeds = @stages.uniq.map do |stage| + builds = builds_for_stage_and_ref( + stage, pipeline.ref, pipeline.tag?, trigger_request) + + Gitlab::Ci::Stage::Seed.new(pipeline, stage, builds) if builds.any? end + + seeds.compact end def build_attributes(name) |