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

Extract global CI config entry configuration setup

parent 8baee987
No related branches found
No related tags found
1 merge request!5087Move CI job config entries from legacy to new config
Pipeline #
Loading
Loading
@@ -39,21 +39,24 @@ module Gitlab
helpers :before_script, :image, :services, :after_script,
:variables, :stages, :types, :cache, :jobs
 
def initialize(config)
return super unless config.is_a?(Hash)
jobs = config.except(*nodes.keys)
global = config.slice(*nodes.keys)
super(global.merge(jobs: jobs))
def initialize(config, **attributes)
super(setup(config), attributes)
@global = self
end
 
def stages
stages_defined? ? stages_value : types_value
end
 
def global
self
private
def setup(config)
return config unless config.is_a?(Hash)
jobs = config.except(*nodes.keys)
global = config.slice(*nodes.keys)
global.merge(jobs: jobs)
end
end
end
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