docker-compose 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docker-compose.yml +5 -0
- data/lib/docker/compose/container.rb +11 -4
- data/lib/docker/compose/session.rb +32 -7
- data/lib/docker/compose/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: 29ab019002254403adcb4a1ac1eb8f0de9eae404
|
4
|
+
data.tar.gz: 3f811096eb9db88a6a258f7d1a3cd52aee1e7b5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43a2569c8c2b64cda6c1f2d0296429a313220c83c8b4a44aef84e344e99cde89d4293b0386ed5623cd572fc59ec9af2b5c7a3a198f6bf24debcfbe1fe5bb8250
|
7
|
+
data.tar.gz: 8dacdec35378f7d22b9c681af9a9411b3617647d4627b54180159b9db0f7139e07f8aac1bca68488211516daff95f061b2d05ed76ae7663e6eb4d58708d177a3
|
data/docker-compose.yml
CHANGED
@@ -38,15 +38,22 @@ module Docker::Compose
|
|
38
38
|
raise Error.new('Service#new', status, 'Unrecognized status') unless status
|
39
39
|
end
|
40
40
|
|
41
|
-
names = names.split(',') if names.is_a?(String)
|
42
|
-
labels = labels.split(',') if labels.is_a?(String)
|
43
|
-
ports = ports.split(',') if ports.is_a?(String)
|
41
|
+
names = names.split(',').map{ |x| x.strip } if names.is_a?(String)
|
42
|
+
labels = labels.split(',').map{ |x| x.strip } if labels.is_a?(String)
|
43
|
+
ports = ports.split(',').map{ |x| x.strip } if ports.is_a?(String)
|
44
44
|
|
45
45
|
@id = id
|
46
46
|
@image = image
|
47
47
|
@size = size
|
48
48
|
@status = status[1].downcase.to_sym
|
49
|
-
|
49
|
+
|
50
|
+
@exitstatus = case @status
|
51
|
+
when :up
|
52
|
+
nil
|
53
|
+
else
|
54
|
+
status[2].to_i
|
55
|
+
end
|
56
|
+
|
50
57
|
@names = names
|
51
58
|
@labels = labels
|
52
59
|
@ports = ports
|
@@ -45,7 +45,6 @@ module Docker::Compose
|
|
45
45
|
inter = @shell.interactive
|
46
46
|
@shell.interactive = false
|
47
47
|
|
48
|
-
|
49
48
|
lines = run!('ps', q:true).split(/[\r\n]+/)
|
50
49
|
containers = Collection.new
|
51
50
|
|
@@ -77,8 +76,8 @@ module Docker::Compose
|
|
77
76
|
true
|
78
77
|
end
|
79
78
|
|
80
|
-
def rm(*services, force:false, volumes:false
|
81
|
-
run!('rm', { f: force, v: volumes
|
79
|
+
def rm(*services, force:false, volumes:false)
|
80
|
+
run!('rm', { f: force, v: volumes }, services)
|
82
81
|
end
|
83
82
|
|
84
83
|
# Idempotently run an arbitrary command with a service container.
|
@@ -88,13 +87,31 @@ module Docker::Compose
|
|
88
87
|
# otherwise, monitor logs in the foreground and shutdown on Ctrl+C
|
89
88
|
# @param [Boolean] no_deps if true, just run specified services without
|
90
89
|
# running the services that they depend on
|
91
|
-
# @param [Array]
|
90
|
+
# @param [Array] env a list of environment variables (see: -e flag)
|
91
|
+
# @param [Array] env_vars DEPRECATED alias for env kwarg
|
92
92
|
# @param [Boolean] rm remove the container when done
|
93
93
|
# @raise [Error] if command fails
|
94
|
-
def run(service, *cmd, detached:false, no_deps:false,
|
95
|
-
|
94
|
+
def run(service, *cmd, detached:false, no_deps:false, env:[], env_vars:nil, rm:false)
|
95
|
+
# handle deprecated kwarg
|
96
|
+
if (env.nil? || env.empty?) && !env_vars.nil?
|
97
|
+
env = env_vars
|
98
|
+
end
|
99
|
+
|
100
|
+
env_params = env.map { |v| { e: v } }
|
96
101
|
run!('run',
|
97
|
-
{ d: detached, no_deps: no_deps, rm: rm }, *
|
102
|
+
{ d: detached, no_deps: no_deps, rm: rm }, *env_params, service, cmd)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Pause running services.
|
106
|
+
# @param [Array] services list of String service names to run
|
107
|
+
def pause(*services)
|
108
|
+
run!('pause', *services)
|
109
|
+
end
|
110
|
+
|
111
|
+
# Unpause running services.
|
112
|
+
# @param [Array] services list of String service names to run
|
113
|
+
def unpause(*services)
|
114
|
+
run!('unpause', *services)
|
98
115
|
end
|
99
116
|
|
100
117
|
# Stop running services.
|
@@ -105,6 +122,14 @@ module Docker::Compose
|
|
105
122
|
run!('stop', { timeout: timeout }, services)
|
106
123
|
end
|
107
124
|
|
125
|
+
# Forcibly stop running services.
|
126
|
+
# @param [Array] services list of String service names to stop
|
127
|
+
# @param [String] name of murderous signal to use, default is 'KILL'
|
128
|
+
# @see Signal.list for a list of acceptable signal names
|
129
|
+
def kill(*services, signal:'KILL')
|
130
|
+
run!('kill', { s: signal }, services)
|
131
|
+
end
|
132
|
+
|
108
133
|
# Figure out which host a port a given service port has been published to.
|
109
134
|
# @param [String] service name of service from docker-compose.yml
|
110
135
|
# @param [Integer] port number of port
|
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: 0.
|
4
|
+
version: 0.8.0
|
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-06-
|
11
|
+
date: 2016-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backticks
|