class Ey::Core::Cli::Recipes::Upload

Public Instance Methods

handle() click to toggle source
# File lib/ey-core/cli/recipes/upload.rb, line 52
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
    puts e.message
    abort "There was a problem uploading the recipes".red
  end

  if switch_active?(:apply)
    opts = {}
    opts[:no_wait] = switch_active?(:no_wait)
    opts[:verbose] = switch_active?(:verbose)
    opts[:watch]   = option(:watch)
    run_chef("main", environment, opts)
  end
end