docker-compose 1.0.0rc2 → 1.0.0rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +2 -1
- data/.travis.yml +2 -1
- data/Gemfile +1 -1
- data/docker-compose.gemspec +2 -2
- data/lib/docker/compose/error.rb +1 -1
- data/lib/docker/compose/mapper.rb +10 -3
- data/lib/docker/compose/session.rb +17 -9
- data/lib/docker/compose/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f54bf97c62e651b2fafd4c8983891c4432f765d
|
4
|
+
data.tar.gz: f71754cf9158c49496842855919ff21b6888bd63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32a4092bfa5f11f01f2444f2e7911b5a5d86883d7caafbaff3fcd1ceb2e345620ffe07faefcec4f7bbde9061187d4968799d6268ae7bad4b0e1fe8ac477b784c
|
7
|
+
data.tar.gz: a91add327817914365a8e5bb5d4c66398a0f2e1aed87ad03dd4754af7d9f508b0ead4ab89ff180d47bb9321087824e9cdfd7358818aa382a29167102ddc6e7b8
|
data/.ruby-version
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
2.
|
1
|
+
2.3.1
|
2
|
+
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/docker-compose.gemspec
CHANGED
@@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
|
-
spec.required_ruby_version = Gem::Requirement.new(
|
22
|
+
spec.required_ruby_version = Gem::Requirement.new('~> 2.1')
|
23
23
|
|
24
|
-
spec.add_dependency 'backticks', '>= 1.0.
|
24
|
+
spec.add_dependency 'backticks', '>= 1.0.0rc2'
|
25
25
|
|
26
26
|
spec.add_development_dependency 'bundler', '~> 1.10'
|
27
27
|
spec.add_development_dependency 'rake', '~> 10.0'
|
data/lib/docker/compose/error.rb
CHANGED
@@ -100,12 +100,19 @@ module Docker::Compose
|
|
100
100
|
# @raise [NoService] if service is not up or does not publish port
|
101
101
|
# @return [Array] (String, Integer) pair of host address and port number
|
102
102
|
def host_and_port(service, port)
|
103
|
-
result = @session.port(service, port)
|
103
|
+
result = @session.port(service, port)
|
104
|
+
if result
|
105
|
+
result.chomp!
|
106
|
+
else
|
107
|
+
raise NoService,
|
108
|
+
"Service '#{service}' not running, or does not " \
|
109
|
+
"publish port '#{port}'"
|
110
|
+
end
|
111
|
+
|
104
112
|
host, port = result.split(':')
|
105
113
|
host = @override_host if @override_host
|
114
|
+
|
106
115
|
[host, Integer(port)]
|
107
|
-
rescue RuntimeError, TypeError
|
108
|
-
raise NoService, "Service '#{service}' not running, or does not publish port '#{port}'"
|
109
116
|
end
|
110
117
|
|
111
118
|
private
|
@@ -15,7 +15,11 @@ module Docker::Compose
|
|
15
15
|
# allowed by the docker-compose CLI, and that options are sometimes renamed
|
16
16
|
# for clarity, e.g. the "-d" flag always becomes the "detached:" kwarg.
|
17
17
|
class Session
|
18
|
-
|
18
|
+
# Working directory (determines compose project name); default is Dir.pwd
|
19
|
+
attr_reader :dir
|
20
|
+
|
21
|
+
# Project file; default is 'docker-compose.yml'
|
22
|
+
attr_reader :file
|
19
23
|
|
20
24
|
def initialize(shell = Backticks::Runner.new(buffered: [:stderr], interactive: true),
|
21
25
|
dir: Dir.pwd, file: 'docker-compose.yml')
|
@@ -110,6 +114,11 @@ module Docker::Compose
|
|
110
114
|
run!('run', o, *env_params, service, cmd)
|
111
115
|
end
|
112
116
|
|
117
|
+
def restart(*services, timeout:10)
|
118
|
+
o = opts(timeout: [timeout, 10])
|
119
|
+
run!('restart', o, *services)
|
120
|
+
end
|
121
|
+
|
113
122
|
# Pause running services.
|
114
123
|
# @param [Array] services list of String service names to run
|
115
124
|
def pause(*services)
|
@@ -216,14 +225,13 @@ module Docker::Compose
|
|
216
225
|
[{ file: @file.to_s }]
|
217
226
|
end
|
218
227
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
end
|
228
|
+
@shell.chdir = dir
|
229
|
+
cmd = @shell.run('docker-compose', *file_args, *args).join
|
230
|
+
status = cmd.status
|
231
|
+
out = cmd.captured_output
|
232
|
+
err = cmd.captured_error
|
233
|
+
status.success? || fail(Error.new(args.first, status, out+err))
|
234
|
+
out
|
227
235
|
end
|
228
236
|
|
229
237
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docker-compose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.0rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Spataro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backticks
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.
|
19
|
+
version: 1.0.0rc2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0.
|
26
|
+
version: 1.0.0rc2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '2.
|
117
|
+
version: '2.1'
|
118
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
120
|
- - ">"
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: 1.3.1
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.5.1
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Wrapper docker-compose with added Rake smarts.
|