indocker 0.1.15 → 0.1.16
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/indocker.rb +1 -1
- data/lib/indocker/container_deployer.rb +1 -0
- data/lib/indocker/deployment_checker.rb +4 -2
- data/lib/indocker/launchers/configuration_deployer.rb +9 -7
- data/lib/indocker/server_pools/deploy_server_pool.rb +19 -19
- data/lib/indocker/server_pools/server_connection.rb +1 -0
- data/lib/indocker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e93eba781605cba8bdb795ed40a03b16d3602508ca427639b42ead50c25b7ec6
|
4
|
+
data.tar.gz: 3e5dc1f5582c8ee45fa4e3583cfea13abf3121e52341eecdc98b8660db700d94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4da7e1049911e4d0c12d89d977cfb568687f61568866ec82f737694c1023984ad97d205d25eaa35e19ebc46843d0743d1df07c833c48d293a5c10ca5de0fd792
|
7
|
+
data.tar.gz: 1a8205455ebf5da34c8039a87c45772807920e362e8814bee275ef578647a15edf9970a9c53196b5805aeba8d4b3b047e30e329b0637d393a390c9d32c68353f
|
data/Gemfile.lock
CHANGED
data/lib/indocker.rb
CHANGED
@@ -369,7 +369,7 @@ module Indocker
|
|
369
369
|
)
|
370
370
|
end
|
371
371
|
|
372
|
-
def launched?(contaner_name, servers:
|
372
|
+
def launched?(contaner_name, servers: nil)
|
373
373
|
silent_logger = Logger.new(File.open(File::NULL, "w"))
|
374
374
|
Indocker::DeploymentChecker
|
375
375
|
.new(silent_logger, silent_logger)
|
@@ -109,13 +109,15 @@ class Indocker::DeploymentChecker
|
|
109
109
|
{ missing_containers: total_missing_containers, invalid_containers: total_invalid_containers }
|
110
110
|
end
|
111
111
|
|
112
|
-
def launched?(container_name, configuration:, servers:)
|
112
|
+
def launched?(container_name, configuration:, servers: nil)
|
113
113
|
container = Indocker.containers.detect { |c| c.name == container_name.to_sym }
|
114
114
|
hostnames = (container.get_start_option(:scale) || 1).times.map do |number|
|
115
115
|
Indocker::ContainerHelper.hostname(configuration.name, container, number)
|
116
116
|
end
|
117
117
|
|
118
|
-
|
118
|
+
servers ||= container.servers.map(&:name)
|
119
|
+
|
120
|
+
result = run(configuration: configuration, servers: container.servers.map(&:name), only_containers: [container.name])
|
119
121
|
result[:missing_containers].empty?
|
120
122
|
end
|
121
123
|
end
|
@@ -258,15 +258,17 @@ class Indocker::Launchers::ConfigurationDeployer
|
|
258
258
|
def collect_soft_dependent_containers(containers, configuration)
|
259
259
|
result = containers
|
260
260
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
end
|
266
|
-
end.flatten
|
261
|
+
soft_dependent_containers = containers
|
262
|
+
.map(&:soft_dependent_containers)
|
263
|
+
.flatten
|
264
|
+
.uniq(&:name)
|
267
265
|
|
266
|
+
result += soft_dependent_containers.select do |container|
|
267
|
+
configuration.enabled_containers.include?(container.name) &&
|
268
|
+
!Indocker.launched?(container.name)
|
269
|
+
end
|
268
270
|
|
269
|
-
result
|
271
|
+
result
|
270
272
|
end
|
271
273
|
|
272
274
|
def compile_image(configuration, image, build_server)
|
@@ -7,35 +7,35 @@ class Indocker::ServerPools::DeployServerPool
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def create_connection!(server)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
def close_sessions
|
20
|
-
@connections.each(&:close_session)
|
10
|
+
connection = Indocker::ServerPools::DeployServerConnection.new(
|
11
|
+
logger: @logger,
|
12
|
+
configuration: @configuration,
|
13
|
+
server: server,
|
14
|
+
)
|
15
|
+
connection.create_session!
|
16
|
+
connection
|
21
17
|
end
|
22
18
|
|
23
|
-
|
24
|
-
|
19
|
+
def find_or_create_connection!(server)
|
20
|
+
@semaphore.synchronize do
|
25
21
|
connection = @connections.detect do |connection|
|
26
22
|
connection.server.host == server.host &&
|
27
23
|
connection.server.port == server.port &&
|
28
24
|
connection.server.user == server.user
|
29
25
|
end
|
30
26
|
if connection.nil?
|
31
|
-
connection =
|
32
|
-
logger: @logger,
|
33
|
-
configuration: @configuration,
|
34
|
-
server: server,
|
35
|
-
)
|
36
|
-
connection.create_session!
|
27
|
+
connection = create_connection!(server)
|
37
28
|
@connections.push(connection)
|
38
29
|
end
|
39
30
|
connection
|
40
31
|
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def each(&proc)
|
35
|
+
@connections.each(&proc)
|
36
|
+
end
|
37
|
+
|
38
|
+
def close_sessions
|
39
|
+
@connections.each(&:close_session)
|
40
|
+
end
|
41
41
|
end
|
data/lib/indocker/version.rb
CHANGED