Class: EYCli::Command::Show
Defined Under Namespace
Classes: ShowParser
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #help ⇒ Object
- #info(app) ⇒ Object
-
#initialize ⇒ Show
constructor
A new instance of Show.
- #invoke ⇒ Object
- #options_parser ⇒ Object
- #status(app) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ Show
Returns a new instance of Show.
4 5 6 |
# File 'lib/ey_cli/commands/show.rb', line 4 def initialize @apps = EYCli::Controller::Apps.new end |
Instance Method Details
#help ⇒ Object
63 64 65 66 67 68 69 |
# File 'lib/ey_cli/commands/show.rb', line 63 def help <<-EOF Show information and status of an application. If a name is not supplied it assumes the current directory as application base. Usage: `ey_cli show app_name' EOF end |
#info(app) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/ey_cli/commands/show.rb', line 16 def info(app) %Q{ #{app.name}: - Info: + git repository: #{app.repository_uri}} end |
#invoke ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/ey_cli/commands/show.rb', line 8 def invoke app = @apps.fetch_app(nil, ) if app EYCli.term.say info(app) EYCli.term.say(status(app)) if app.environments end end |
#options_parser ⇒ Object
71 72 73 |
# File 'lib/ey_cli/commands/show.rb', line 71 def ShowParser.new end |
#status(app) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/ey_cli/commands/show.rb', line 23 def status(app) status = %Q{ - Status per environment:} app.environments.each do |env| status << %Q{ + #{env.name}: - environment: #{env.framework_env} - app stack: #{env.app_server_stack_name} - IP address: #{env.load_balancer_ip_address} - status: #{env.instance_status}} if deploy = env.last_deployment(app) status << %Q{ + last deploy info: - commit: #{deploy.commit} - created at: #{deploy.created_at} - finished at: #{deploy.finished_at} - migrated: #{deploy.migrate}} if deploy.migrate status << %Q{ - migrate command: #{deploy.migrate_command}} end end if env.instances status << %Q{ - Status per instance:} env.instances.each do |instance| status << %Q{ + #{instance.role}: - Amazon ID: #{instance.amazon_id} - status: #{instance.status}} end end end status end |