Method: Shiplane::ConvertComposeFile#converted_output

Defined in:
lib/shiplane/convert_compose_file.rb

#converted_outputObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/shiplane/convert_compose_file.rb', line 33

def converted_output
  @converted_output ||= converted_compose_hash.dup.tap do |hash|
    build_config.fetch('artifacts', {}).each do |(appname, config)|
      hash.deep_merge!({ 'services' => { appname => { 'image' => "#{config['repo']}:#{sha}" } } })
    end

    hash.traverse! do |key, value|
      if (key == 'env_file' && value == '.env.development')
        [key, '.env.production']
      else
        [key, value]
      end
    end
  end
end