Commit 6c704fd9 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Inject dependencies into each CI config entry node

parent 7bbb523b
...@@ -25,7 +25,7 @@ module Gitlab ...@@ -25,7 +25,7 @@ module Gitlab
private private
def compose! def compose!(_deps)
self.class.nodes.each do |key, factory| self.class.nodes.each do |key, factory|
factory factory
.value(@config[key]) .value(@config[key])
......
...@@ -20,11 +20,14 @@ module Gitlab ...@@ -20,11 +20,14 @@ module Gitlab
@validator.validate(:new) @validator.validate(:new)
end end
def process! def process!(deps = nil)
return unless valid? return unless valid?
compose! compose!(deps)
descendants.each(&:process!)
descendants.each do |entry|
entry.process!(deps)
end
end end
def leaf? def leaf?
...@@ -76,7 +79,7 @@ module Gitlab ...@@ -76,7 +79,7 @@ module Gitlab
private private
def compose! def compose!(_deps)
end end
end end
end end
......
...@@ -36,9 +36,13 @@ module Gitlab ...@@ -36,9 +36,13 @@ module Gitlab
helpers :before_script, :image, :services, :after_script, helpers :before_script, :image, :services, :after_script,
:variables, :stages, :types, :cache, :jobs :variables, :stages, :types, :cache, :jobs
def process!(_deps = nil)
super(self)
end
private private
def compose! def compose!(_deps)
super super
compose_jobs! compose_jobs!
......
...@@ -107,7 +107,7 @@ module Gitlab ...@@ -107,7 +107,7 @@ module Gitlab
after_script: after_script } after_script: after_script }
end end
def compose! def compose!(_deps)
super super
if type_defined? && !stage_defined? if type_defined? && !stage_defined?
......
...@@ -28,7 +28,7 @@ module Gitlab ...@@ -28,7 +28,7 @@ module Gitlab
private private
def compose! def compose!(_deps)
@config.each do |name, config| @config.each do |name, config|
node = hidden?(name) ? Node::HiddenJob : Node::Job node = hidden?(name) ? Node::HiddenJob : Node::Job
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment