docker-compose-wait 0.1.3
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 +7 -0
- data/bin/docker-compose-wait +40 -0
- metadata +74 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d654a5b6bc388d91d7fbf7aa0e47fcff18dd82bb
|
4
|
+
data.tar.gz: ec2892307902ff54c966e783544dba41dcd706d4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7256c60e90612571749a1e1e1e7d26e7eee6cf21f2f0992a9281d865ae10da186f23b0f76720599acfc7596495c9c1ac3b8e7e57a78572145ce99261d9bc51dc
|
7
|
+
data.tar.gz: 091d0bc15cd9170911c980f3a80b5eb39cd1f4e4f4cba3d9c54b6087823126f31e8dec1287674f0e9107b2cf1dc837ea8752f5be80d2afd7ce9531777511a847
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
require 'open3'
|
5
|
+
|
6
|
+
options = {regexp: false}
|
7
|
+
|
8
|
+
optparser = OptionParser.new do |opts|
|
9
|
+
opts.banner = "USAGE: #$0 [--regexp] docker-compose-container pattern"
|
10
|
+
opts.on('--[no-]regexp') do |regexp|
|
11
|
+
options[:regexp] = regexp
|
12
|
+
end
|
13
|
+
opts.on_tail('--help', 'Show this message') do
|
14
|
+
puts opts
|
15
|
+
exit
|
16
|
+
end
|
17
|
+
end
|
18
|
+
optparser.parse!
|
19
|
+
|
20
|
+
container, pattern = ARGV
|
21
|
+
|
22
|
+
if container.nil? || container.empty? || pattern.nil? || pattern.empty?
|
23
|
+
STDERR.puts(optparser)
|
24
|
+
exit!
|
25
|
+
end
|
26
|
+
|
27
|
+
Open3.popen2e('docker-compose', 'logs', '-f', container) do |stdin, output, wait_thr|
|
28
|
+
stdin.close
|
29
|
+
loop do
|
30
|
+
line = output.readline
|
31
|
+
break unless line
|
32
|
+
puts line
|
33
|
+
if options[:regexp]
|
34
|
+
break if line =~ /#{pattern}/
|
35
|
+
else
|
36
|
+
break if line.include?(pattern)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
wait_thr.kill
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: docker-compose-wait
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bachue Zhou
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: Print docker-compose log, quit when match
|
42
|
+
email:
|
43
|
+
- bachue.shu@gmail.com
|
44
|
+
executables:
|
45
|
+
- docker-compose-wait
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- bin/docker-compose-wait
|
50
|
+
homepage: https://github.com/bachue/docker-compose-wait
|
51
|
+
licenses:
|
52
|
+
- Commercial License
|
53
|
+
metadata: {}
|
54
|
+
post_install_message:
|
55
|
+
rdoc_options: []
|
56
|
+
require_paths:
|
57
|
+
- lib
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
requirements: []
|
69
|
+
rubyforge_project:
|
70
|
+
rubygems_version: 2.5.1
|
71
|
+
signing_key:
|
72
|
+
specification_version: 4
|
73
|
+
summary: Print docker-compose log, quit when match
|
74
|
+
test_files: []
|