Class: Chef::Knife::AppUpload

Inherits:
Chef::Knife show all
Defined in:
lib/chef/knife/app_upload.rb

Instance Method Summary collapse

Instance Method Details

#runObject

This method will be executed when you run this knife command.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/chef/knife/app_upload.rb', line 12

def run

  # Get Arguments
  if @name_args.size != 1
    ui.info("Please specify an app_file")
    show_usage
    exit 1
  end

  app_config_file = @name_args[0]

  # Build app config from file
  app_config = Chapp::AppConfig.from_file app_config_file

  # Write the app config
  Chapp.database.write_app_config app_config

  puts "Uploaded app [#{app_config.id_hash}]"
end