Class: Kontena::Cli::Apps::BuildCommand

Inherits:
Kontena::Command
  • Object
show all
Includes:
Common, DockerHelper, Common
Defined in:
lib/kontena/cli/apps/build_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DockerHelper

#build_docker_image, #dockerfile_exist?, #image_exist?, #process_docker_images, #push_docker_image, #run_pre_build_hook, #validate_image_name

Methods included from Common

#abort_on_validation_errors, #app_json, #create_yml, #current_dir, #display_notifications, #generate_services, #hint_on_validation_notifications, #prefixed_name, #project_name_from_yaml, #read_yaml, #require_config_file, #service_exists?, #service_prefix, #services_from_yaml, #set_env_variables, #token, #valid_addons

Instance Attribute Details

#servicesObject (readonly)

Returns the value of attribute services.



16
17
18
# File 'lib/kontena/cli/apps/build_command.rb', line 16

def services
  @services
end

Instance Method Details

#executeObject



18
19
20
21
22
23
24
25
26
# File 'lib/kontena/cli/apps/build_command.rb', line 18

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