docker_toolkit 0.1.19 → 0.1.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/docker_toolkit/version.rb +1 -1
- data/lib/docker_toolkit/watcher.rb +21 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bf86f05ad92b1bc8a9d2c716f4d43ed623822704d6b2f7f2cb1cd450bba045b
|
4
|
+
data.tar.gz: 633486188aa3b061625e24d3e8b4b854a9e59b7ac2ca773a041ef6fef0b45c1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b228ca1cee6f826eadf20eb7fc8b1eeae3dd7a50b5e2e636e130904a5811107fde91f211324378510113b2ffb9bfdd39926a240e5089c51b18dab55eeaf1211
|
7
|
+
data.tar.gz: 8cacc284e037a69dec8f61046c9b85cfdd0c2e02ca4399b6d4094d15293aff4bd4deed4b958b83ce564442a8bf0f11b049ad753ec44d0d01c042cc789e0dfa3e
|
data/Gemfile.lock
CHANGED
@@ -30,7 +30,18 @@ module DockerToolkit
|
|
30
30
|
rescue StandardError
|
31
31
|
nil
|
32
32
|
end
|
33
|
-
|
33
|
+
if meta[:termcmd].is_a? String
|
34
|
+
log "Terminating by #{meta[:termcmd].gsub('%PID%', meta[:process].pid.to_s)}..."
|
35
|
+
output = `#{meta[:termcmd].gsub('%PID%', meta[:process].pid.to_s)}`
|
36
|
+
if $?.success?
|
37
|
+
log "ok: #{output}"
|
38
|
+
else
|
39
|
+
log "Error: #{output}"
|
40
|
+
::Process.kill 'TERM', meta[:process].pid
|
41
|
+
end
|
42
|
+
else
|
43
|
+
::Process.kill 'TERM', meta[:process].pid
|
44
|
+
end
|
34
45
|
end
|
35
46
|
|
36
47
|
terminating.each do |meta|
|
@@ -75,6 +86,13 @@ module DockerToolkit
|
|
75
86
|
end
|
76
87
|
|
77
88
|
def add(*cmd)
|
89
|
+
options = cmd.last
|
90
|
+
if options.is_a? Hash
|
91
|
+
cmd.pop
|
92
|
+
else
|
93
|
+
options = {}
|
94
|
+
end
|
95
|
+
|
78
96
|
cmd = cmd.flatten.map{|c| c.to_s.strip }.reject(&:empty?)
|
79
97
|
process = ChildProcess.build(*cmd)
|
80
98
|
|
@@ -90,7 +108,8 @@ module DockerToolkit
|
|
90
108
|
process: process,
|
91
109
|
stdout: rout,
|
92
110
|
stderr: rerr,
|
93
|
-
stdin: process.io.stdin
|
111
|
+
stdin: process.io.stdin,
|
112
|
+
termcmd: options[:termcmd],
|
94
113
|
}
|
95
114
|
|
96
115
|
@threads << Thread.new(meta[:stdout], STDOUT) do |io, out|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docker_toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Godko Ivan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-09-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: diplomat
|
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
163
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.7.
|
164
|
+
rubygems_version: 2.7.7
|
165
165
|
signing_key:
|
166
166
|
specification_version: 4
|
167
167
|
summary: Helper scripts for work with docker and consul
|