deis-interactive 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 990fc5adb8cf8c04d04e7ff131f2ca122e00f874
4
- data.tar.gz: aea002d3cbef0d5ff35570d1f8cc2eea4bb94a3c
3
+ metadata.gz: 2b141e99f1a27f32beb7d313434644463f085df1
4
+ data.tar.gz: f9211cc03c710c747571f5d29e69622b51785d24
5
5
  SHA512:
6
- metadata.gz: 2215e879faa4f33fae680277342cb1c1a9fd1d3708bd8f2a373c2eefc04b03482a27c846b0067fae269e6d3aec28ef0a96d7a2c3ad007abdbfb1041cdb746141
7
- data.tar.gz: 9d5d75407c940d12b403be9c55d70ccf4609b74a1be97c275127f8b10dcd353bcba43288930ee2e954a387857554d9e0b5fa24128cc26b185cf30e3699d96091
6
+ metadata.gz: 84e14bdc9c978b156dcd756431956396199b31ed236fe1162da871f831682b5f411b90a480c49a73f1a99b632dbbea12544052098ab8505a6f7e1e5fa1aa5f24
7
+ data.tar.gz: 358ae93b910b75a8c3e0bea45602ad30e2320638eb18e43429203585fcfb1c902c2fc2fd5d3b312083b4c11fdd7a6dcaf108e23242f2b875dde5e2b8bdcc23a2
data/bin/deis-rails CHANGED
@@ -19,16 +19,18 @@ class DeisRails < Thor
19
19
  DeisInteractive::Rails::Exec.new(app, command, params).perform
20
20
  end
21
21
 
22
- desc "logs [-f] -a APP [-d PROCESS]", "logs on an app"
22
+ desc "logs [-n COUNT] [-f] -a APP [-d PROCESS]", "logs on an app"
23
23
  method_option :app, aliases: ["a"], type: :string, required: true, desc: "Name of the app"
24
24
  method_option :process, aliases: ["p"], type: :string, required: false, desc: "Processes to be logged on"
25
25
  method_option :follow, aliases: ["f"], type: :boolean, required: false, desc: "Tail the log"
26
+ method_option :count, aliases: ["n"], type: :numeric, required: false, desc: "Number of lines"
26
27
  def logs
27
28
  require_relative "../lib/deis-interactive/rails/logs"
28
29
  app = options[:app]
29
30
  process = options[:process]
30
31
  follow = options[:follow]
31
- DeisInteractive::Rails::Logs.new(app, process, follow: follow).perform
32
+ count = options[:count]
33
+ DeisInteractive::Rails::Logs.new(app, process, follow: follow, count: count).perform
32
34
  end
33
35
  end
34
36
 
@@ -7,14 +7,16 @@ module DeisInteractive
7
7
  module Rails
8
8
  class Logs < Base
9
9
  attr_reader :follow
10
+ attr_reader :count
10
11
  attr_reader :pids
11
12
  attr_reader :outputs
12
13
 
13
- def initialize(app, process, follow: false)
14
+ def initialize(app, process, follow: false, count: 20)
14
15
  super(app, process)
15
16
  @follow = follow
16
17
  @pids = Concurrent::Array.new
17
18
  @outputs = Concurrent::Array.new
19
+ @count = count
18
20
 
19
21
  at_exit do
20
22
  pids.each do |pid|
@@ -77,7 +79,7 @@ module DeisInteractive
77
79
 
78
80
  def log_pod(pod_id)
79
81
  Thread.new do
80
- cmd = "kubectl logs #{follow_option} --tail 20 #{pod_id} --namespace #{app}"
82
+ cmd = "kubectl logs #{follow_option} --tail #{count} #{pod_id} --namespace #{app}"
81
83
  Open3.popen2e(cmd) do |_, out_err, wait_thr|
82
84
  pids << wait_thr.pid
83
85
  out_err.each { |line| outputs << line }
@@ -1,3 +1,3 @@
1
1
  module DeisInteractive
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deis-interactive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phuong Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-26 00:00:00.000000000 Z
11
+ date: 2018-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler