Sha256: 6c1aa42b7c3dfebb9cd1a33c27b910eec27a16b27a1521d93f82f1465802149e

Contents?: true

Size: 838 Bytes

Versions: 121

Compression:

Stored size: 838 Bytes

Contents

require 'yaml'
require_relative 'service_generator'

module Kontena::Cli::Apps
  class ServiceGeneratorV2 < ServiceGenerator

    def parse_data(options)
      data = super(options)
      data['net'] = options['network_mode'] if options['network_mode']
      data['log_driver'] = options.dig('logging', 'driver')
      data['log_opts'] = options.dig('logging', 'options')
      if options['depends_on']
        data['links'] ||= []
        data['links'] = (data['links'] + parse_links(options['depends_on'])).uniq
      end
      data
    end

    def parse_build_options(options)
      unless options['build'].is_a?(Hash)
        options['build'] = { 'context' => options['build']}
      end
      options['build']['args'] = parse_build_args(options['build']['args']) if options['build']['args']
      options['build']
    end
  end
end

Version data entries

121 entries across 121 versions & 2 rubygems

Version Path
kontena-cli-1.3.5 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.3.5.rc1 lib/kontena/cli/apps/service_generator_v2.rb
kontena-plugin-app-command-0.1.0 lib/kontena/cli/apps/service_generator_v2.rb
kontena-plugin-app-command-0.1.0.rc1 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.4.0.pre6 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.4.0.pre5 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.4.0.pre4 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.4.0.pre3 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.4.0.pre2 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.4.0.pre1 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.3.4 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.3.4.rc1 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.3.3 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.3.3.rc1 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.3.2 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.3.2.rc2 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.3.2.rc1 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.3.1 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.3.1.rc2 lib/kontena/cli/apps/service_generator_v2.rb
kontena-cli-1.3.1.rc1 lib/kontena/cli/apps/service_generator_v2.rb