class Heroku::Command::Stack

manage the stack for an app

Public Instance Methods

index() click to toggle source
stack

show the list of available stacks

Example:

$ heroku stack
=== example Available Stacks
  cedar-10
* cedar-14
# File lib/heroku/command/stack.rb, line 19
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'] ? '*' : ' ', Codex.out(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
set() click to toggle source

stack:set STACK

set new app stack

# File lib/heroku/command/stack.rb, line 39
def set
  unless stack = Codex.in(shift_argument)
    error("Usage: heroku stack:set STACK.\nMust specify target stack.")
  end

  api.put_stack(app, stack)
  display "Stack set. Next release on #{app} will use #{Codex.out(stack)}."
  display "Run `git push heroku master` to create a new release on #{Codex.out(stack)}."
end