Skip to content
Snippets Groups Projects
Unverified Commit 0bc522ee authored by Tim Sharpe's avatar Tim Sharpe Committed by GitHub
Browse files

Merge pull request #298 from rodjek/gh-290

(#290) Do not manually generate YAML in .gitlab-ci.yml
parents 25d1ec66 1e506507
Branches
Tags
No related merge requests found
...@@ -118,35 +118,5 @@ beaker: ...@@ -118,35 +118,5 @@ beaker:
<% end -%> <% end -%>
<% end -%> <% end -%>
<% if configs['custom_jobs'] -%> <% if configs['custom_jobs'] -%>
<% configs['custom_jobs'].each do |job, params| -%> <%= YAML.dump(configs['custom_jobs']).sub(%r{\A---\r?\n}m, '') %>
<%= job %>:
<% params.each do |param, config| -%>
<% if (config.is_a?(Array) || config.is_a?(Hash)) && config.empty? -%>
<%= param %>: <%= config.inspect %>
<% elsif config.is_a?(Array) -%>
<%= param %>:
<% config.each do |element| -%>
- <%= element %>
<% end -%>
<% elsif config.is_a?(Hash) -%>
<%= param %>:
<% config.each do |element, value| -%>
<% if value.is_a?(Array) -%>
<% if value.empty? -%>
<%= element %>: <%= value.inspect %>
<% else -%>
<%= element %>:
<% value.each do |content| -%>
- <%= content %>
<% end -%>
<% end -%>
<% else -%>
<%= element %>: '<%= value %>'
<% end -%>
<% end -%>
<% else -%>
<%= param %>: '<%= config %>'
<% end -%>
<% end %>
<% end -%>
<% end -%> <% end -%>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment