Class: Kontena::Cli::Apps::ConfigCommand

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

Instance Method Summary collapse

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 Method Details

#executeObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/kontena/cli/apps/config_command.rb', line 14

def execute
  require_config_file(filename)
  services = services_from_yaml(filename, service_list, service_prefix, skip_validation?)
  services.each do |name, config|
    config['cmd'] = config['cmd'].join(" ") if config['cmd']
    config.delete_if {|key, value| value.nil? || (value.respond_to?(:empty?) && value.empty?) }
  end
  services = { 'services' => services }
  puts services.to_yaml
end