deis-interactive 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/deis-rails +4 -2
- data/lib/deis-interactive/rails/logs.rb +4 -2
- data/lib/deis-interactive/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b141e99f1a27f32beb7d313434644463f085df1
|
4
|
+
data.tar.gz: f9211cc03c710c747571f5d29e69622b51785d24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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 }
|
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.
|
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-
|
11
|
+
date: 2018-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|