Sha256: c08a90f977d041e042488f646df1a1b36e0f00c7f8afce544106ef873c002438

Contents?: true

Size: 818 Bytes

Versions: 6

Compression:

Stored size: 818 Bytes

Contents

require 'shellwords'

module Aptible
  module CLI
    module Subcommands
      module Tail
        def self.included(thor)
          thor.class_eval do
            include Helpers::Operation
            include Helpers::App

            desc 'logs', 'Follows logs from a running app'
            option :app
            def logs
              app = ensure_app(options)
              host = app.account.bastion_host
              port = app.account.dumptruck_port

              ENV['ACCESS_TOKEN'] = fetch_token
              ENV['APTIBLE_APP'] = app.handle

              opts = " -o 'SendEnv=*' -o StrictHostKeyChecking=no " \
                     '-o UserKnownHostsFile=/dev/null'
              Kernel.exec "ssh #{opts} -p #{port} root@#{host}"
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
aptible-cli-0.5.5 lib/aptible/cli/subcommands/logs.rb
aptible-cli-0.5.4 lib/aptible/cli/subcommands/logs.rb
aptible-cli-0.5.2 lib/aptible/cli/subcommands/logs.rb
aptible-cli-0.5.1 lib/aptible/cli/subcommands/logs.rb
aptible-cli-0.5.0 lib/aptible/cli/subcommands/logs.rb
aptible-cli-0.4.4 lib/aptible/cli/subcommands/logs.rb