Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/ci
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-05-31 16:13:40 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-05-31 16:13:40 +0300
commitc72e21fd9764845a107005562ff8ce1c06cac431 (patch)
tree1acd707d049036bd532046b91e5f25d55633744e /lib/ci
parentc881425b665b9c0b022dc2e213486aecc320ec7e (diff)
Return stage seeds object from YAML processor
Diffstat (limited to 'lib/ci')
-rw-r--r--lib/ci/gitlab_ci_yaml_processor.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb
index 5e6c3d029c6..4b0e87a945b 100644
--- a/lib/ci/gitlab_ci_yaml_processor.rb
+++ b/lib/ci/gitlab_ci_yaml_processor.rb
@@ -50,14 +50,14 @@ module Ci
end
end
- def stages_for_ref(ref, tag = false, trigger_request = nil)
- stages = @stages.uniq.map do |stage|
- builds = builds_for_stage_and_ref(stage, ref, tag, trigger_request)
+ 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)
- { name: stage, builds_attributes: builds.to_a } if builds.any?
+ seeds.append_stage(stage, builds) if builds.any?
+ end
end
-
- stages.compact.sort_by { |stage| @stages.index(stage[:name]) }
end
def build_attributes(name)