Class: Azuki::Command::Stack

Inherits:
Base
  • Object
show all
Defined in:
lib/azuki/command/stack.rb

Overview

manage the stack for an app

Instance Attribute Summary

Attributes inherited from Base

#args, #options

Instance Method Summary collapse

Methods inherited from Base

#api, #app, #azuki, #initialize, namespace

Methods included from Helpers

#action, #ask, #confirm, #confirm_billing, #confirm_command, #create_git_remote, #deprecate, #display, #display_header, #display_object, #display_row, #display_table, #error, error_with_failure, error_with_failure=, extended, extended_into, #fail, #format_bytes, #format_date, #format_error, #format_with_bang, #get_terminal_environment, #git, #has_git?, #home_directory, #hprint, #hputs, included, included_into, #json_decode, #json_encode, #launchy, #line_formatter, #longest, #output_with_bang, #quantify, #redisplay, #retry_on_exception, #run_command, #running_on_a_mac?, #running_on_windows?, #set_buffer, #shell, #spinner, #status, #string_distance, #styled_array, #styled_error, #styled_hash, #styled_header, #suggestion, #time_ago, #truncate, #with_tty

Constructor Details

This class inherits a constructor from Azuki::Command::Base

Instance Method Details

#indexObject

stack

show the list of available stacks

Example:

$ azuki stack

example Available Stacks

bamboo-mri-1.9.2
bamboo-ree-1.8.7
  • cedar



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/azuki/command/stack.rb', line 20

def index
  validate_arguments!

  stacks_data = api.get_stack(app).body

  styled_header("#{app} Available Stacks")
  stacks = stacks_data.map do |stack|
    row = [stack['current'] ? '*' : ' ', stack['name']]
    row << '(beta)' if stack['beta']
    row << '(deprecated)' if stack['deprecated']
    row << '(prepared, will migrate on next git push)' if stack['requested']
    row.join(' ')
  end
  styled_array(stacks)
end

#migrateObject

stack:migrate STACK

prepare migration of this app to a new stack

Example:

$ azuki stack:migrate cedar —–> Preparing to migrate evening-warrior-2345

bamboo-mri-1.9.2 -> bamboo-ree-1.8.7

NOTE: You must specify ALL gems (including Rails) in manifest

Please read the migration guide:
http://devcenter.azukiapp.com/articles/bamboo

—–> Migration prepared.

Run 'git push azuki master' to execute migration.


54
55
56
57
58
59
60
# File 'lib/azuki/command/stack.rb', line 54

def migrate
  unless stack = shift_argument
    error("Usage: azuki stack:migrate STACK.\nMust specify target stack.")
  end

  display(api.put_stack(app, stack).body)
end