Class: EY::CLI::Recipes
Constant Summary
Constants inherited from Thor
Thor::DynamicTask, Thor::HELP_MAPPINGS, Thor::HiddenTask, Thor::THOR_RESERVED_WORDS, Thor::UndefinedTaskError, Thor::VERSION
Instance Attribute Summary
Attributes included from Thor::Base
#args, #options, #parent_options
Instance Method Summary collapse
Methods inherited from Thor
check_unknown_options!, check_unknown_options?, command_help, default_command, desc, #help, help, long_desc, map, method_option, method_options, package_name, printable_commands, register, stop_on_unknown_option!, stop_on_unknown_option?, subcommand, subcommands
Methods included from Thor::Base
included, #initialize, register_klass_file, shell, shell=, subclass_files, subclasses
Instance Method Details
#apply ⇒ Object
22 23 24 25 |
# File 'lib/engineyard/cli/recipes.rb', line 22 def apply environment = fetch_environment([:environment], [:account]) apply_recipes(environment) end |
#download ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/engineyard/cli/recipes.rb', line 106 def download if File.exist?('cookbooks') raise EY::Error, "Cannot download recipes, cookbooks directory already exists." end environment = fetch_environment([:environment], [:account]) recipes = environment.download_recipes cmd = "tar xzf '#{recipes.path}' cookbooks" if system(cmd) ui.info "Recipes downloaded successfully for #{environment.name}" else raise EY::Error, "Could not unarchive recipes.\nCommand `#{cmd}` exited with an error." end end |
#upload ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/engineyard/cli/recipes.rb', line 52 def upload environment = fetch_environment([:environment], [:account]) upload_recipes(environment, [:file]) if [:apply] apply_recipes(environment) end end |