Sha256: 16bfff3e042c68dbed55f17114eb4340c1d23c00fdaa5e3e72f8c09279085dca

Contents?: true

Size: 956 Bytes

Versions: 14

Compression:

Stored size: 956 Bytes

Contents

require_relative 'common'
require_relative 'docker_helper'

module Kontena::Cli::Apps
  class BuildCommand < Clamp::Command
    include Kontena::Cli::Common
    include Common
    include DockerHelper

    option ['-p', '--project-name'], 'NAME', 'Specify an alternate project name (default: directory name)'
    option ['-f', '--file'], 'FILE', 'Specify an alternate Kontena compose file', attribute_name: :filename, default: 'kontena.yml'
    option ['--no-cache'], :flag, 'Do not use cache when building the image', default: false
    parameter "[SERVICE] ...", "Services to build"

    attr_reader :services

    def execute
      require_config_file(filename)
      @services = services_from_yaml(filename, service_list, service_prefix)
      if services.none?{ |name, service| service['build'] }
        abort 'Not found any service with build option'.colorize(:red)
      end
      process_docker_images(services, true, no_cache?)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
kontena-cli-0.15.5 lib/kontena/cli/apps/build_command.rb
kontena-cli-0.15.5.rc2 lib/kontena/cli/apps/build_command.rb
kontena-cli-0.15.5.rc1 lib/kontena/cli/apps/build_command.rb
kontena-cli-0.15.4 lib/kontena/cli/apps/build_command.rb
kontena-cli-0.15.4.rc2 lib/kontena/cli/apps/build_command.rb
kontena-cli-0.15.4.rc1 lib/kontena/cli/apps/build_command.rb
kontena-cli-0.15.4.pre1 lib/kontena/cli/apps/build_command.rb
kontena-cli-0.15.3 lib/kontena/cli/apps/build_command.rb
kontena-cli-0.15.2 lib/kontena/cli/apps/build_command.rb
kontena-cli-0.15.1 lib/kontena/cli/apps/build_command.rb
kontena-cli-0.15.0 lib/kontena/cli/apps/build_command.rb
kontena-cli-0.15.0.rc3 lib/kontena/cli/apps/build_command.rb
kontena-cli-0.15.0.rc2 lib/kontena/cli/apps/build_command.rb
kontena-cli-0.15.0.rc1 lib/kontena/cli/apps/build_command.rb