Class: Ebfly::App

Inherits:
Thor
  • Object
show all
Includes:
Command
Defined in:
lib/ebfly/command/app.rb

Constant Summary

Constants included from Command

Command::PREDEFINED_SOLUTION_STACKS

Instance Method Summary collapse

Methods included from Command

#debug, #eb, #env_name, #exist_command?, #run, #s3, #s3_bucket, #solution_stack, #style_err, #tier

Instance Method Details

#create(name) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/ebfly/command/app.rb', line 7

def create(name)
  puts "Create app: #{name} ..."
  opts = { application_name: name }
  opts.merge!(description: options[:d]) if options[:d]

  debug(opts)
  ret = run { eb.create_application(opts) }
  debug(ret)
  show_app_info(ret[:application])
end

#delete(name) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/ebfly/command/app.rb', line 20

def delete(name)
  puts "Delete app: #{name} ..."
  opts = {
    application_name: name,
    terminate_env_by_force: options[:f]
  } 
  debug(opts)
  run { eb.delete_application(opts) }
  puts "Done"
end

#info(name) ⇒ Object



32
33
34
35
36
37
38
39
40
41
# File 'lib/ebfly/command/app.rb', line 32

def info(name)
  begin
    inf = app_info(name)
    debug inf
    show_app_info(inf)
  rescue => err
    style_err err
    exit 1
  end
end

#versions(name) ⇒ Object



44
45
46
47
48
49
50
51
# File 'lib/ebfly/command/app.rb', line 44

def versions(name)
  opts = {
    application_name: name
  } 
  ret = run { eb.describe_application_versions(opts) }
  debug(ret)
  show_app_versions(ret[:application_versions])
end