Skip to content
Snippets Groups Projects
Commit 6c704fd9 authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Inject dependencies into each CI config entry node

parent 7bbb523b
No related branches found
No related tags found
1 merge request!6009Pass dependencies to CI configuration nodes
Loading
@@ -25,7 +25,7 @@ module Gitlab
Loading
@@ -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])
Loading
Loading
Loading
@@ -20,11 +20,14 @@ module Gitlab
Loading
@@ -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?
Loading
@@ -76,7 +79,7 @@ module Gitlab
Loading
@@ -76,7 +79,7 @@ module Gitlab
   
private private
   
def compose! def compose!(_deps)
end end
end end
end end
Loading
Loading
Loading
@@ -36,9 +36,13 @@ module Gitlab
Loading
@@ -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!
Loading
Loading
Loading
@@ -107,7 +107,7 @@ module Gitlab
Loading
@@ -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?
Loading
Loading
Loading
@@ -28,7 +28,7 @@ module Gitlab
Loading
@@ -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
   
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment