From 6c7c4ce666f2aec5ee8b71aefc00b9b916d20cff Mon Sep 17 00:00:00 2001 From: Jesse Scott Date: Tue, 16 Apr 2019 12:15:47 -0700 Subject: [PATCH] (MAINT) Ensure .gitlab-ci.yaml configs are merged in the correct order --- moduleroot/.gitlab-ci.yml.erb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/moduleroot/.gitlab-ci.yml.erb b/moduleroot/.gitlab-ci.yml.erb index af9cf609..043064d8 100644 --- a/moduleroot/.gitlab-ci.yml.erb +++ b/moduleroot/.gitlab-ci.yml.erb @@ -1,12 +1,13 @@ --- <% if @configs['override'] && @configs.has_key?('custom') -%> -<% configs = @configs['custom'] -%> +<% configs = @configs['custom'].dup -%> <% elsif @configs['defaults'] && !@configs.has_key?('custom') -%> -<% configs = @configs['defaults'] -%> +<% configs = @configs['defaults'].dup -%> <% else -%> <% require 'deep_merge/core' -%> -<% defaults = @configs['defaults'].dup -%> -<% configs = DeepMerge::deep_merge!(defaults, @configs['custom']) -%> +<% configs = {} -%> +<% configs.deep_merge!(@configs['defaults']) -%> +<% configs.deep_merge!(@configs['custom']) -%> <% end -%> stages: <% unless @configs['override'] -%>