Class: Ey::Core::Cli::Recipes::Upload

Inherits:
Subcommand
  • Object
show all
Includes:
Helpers::Archive, Helpers::Chef
Defined in:
lib/ey-core/cli/recipes/upload.rb

Instance Method Summary collapse

Methods included from Helpers::Chef

#run_chef, #upload_recipes

Methods included from Helpers::Archive

#archive_directory, #gzip, #ungzip, #untar

Methods inherited from Subcommand

#handle_core_error, #run_handle, #setup

Methods included from Helpers::Core

#core_account, #core_accounts, #core_application_for, #core_client, #core_environment_for, #core_operator_and_environment_for, #core_server_for, #core_url, #core_yaml, #eyrc_yaml, included, #longest_length_by_name, #operator, #unauthenticated_core_client, #write_core_yaml

Instance Method Details

#handleObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/ey-core/cli/recipes/upload.rb', line 39

def handle
  operator, environment = core_operator_and_environment_for(options)
  path = option(:file) || "cookbooks/"

  puts "Uploading custom recipes for #{environment.name}".green

  begin
    upload_recipes(environment, path)
    puts "Uploading custom recipes complete".green
  rescue => e
    abort "There was a problem uploading the recipes".red
  end

  if switch_active?(:apply)
    run_chef("custom", environment)
  end
end