7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/aptible/cli/subcommands/logs.rb', line 7
def self.included(thor)
thor.class_eval do
include Helpers::Operation
include Helpers::AppOrDatabase
desc 'logs [--app APP | --database DATABASE]',
'Follows logs from a running app or database'
app_or_database_options
def logs
resource = ensure_app_or_database(options)
unless resource.status == 'provisioned'
raise Thor::Error, 'Unable to retrieve logs. ' \
"Have you deployed #{resource.handle} yet?"
end
op = resource.create_operation!(type: 'logs', status: 'succeeded')
ENV['ACCESS_TOKEN'] = fetch_token
exit_with_ssh_portal(op, '-o', 'SendEnv=ACCESS_TOKEN', '-T')
end
end
end
|