kuber_kit 0.4.8 → 0.4.9
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/kuber_kit/service_deployer/strategies/docker.rb +18 -1
- data/lib/kuber_kit/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: 766eae8b402b82c6e307942d24f2ee60d87197ef0b966f8551e17b2926a8210b
|
4
|
+
data.tar.gz: eae14447e34ab527affdfbbbdd9b34027470b6c2b54b63bb27be8cdf651bbd27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '086f8e0c1983f00c3b517d4bf8a90c53d4ba58395b429d65a0dd2afeb8e80aae0e5120adf3ea1936b3f7c343de57378ef4e6e5b45c4836eb3de82f73a8198bc7'
|
7
|
+
data.tar.gz: d236328533a9f15eba54dba8c777e54821ddab141aaf46ada97e88d35a7fc7fe7048bcb49ddb719b081d55a36883a8434c39632343a210b174343851eb43fa93
|
data/Gemfile.lock
CHANGED
@@ -6,7 +6,9 @@ class KuberKit::ServiceDeployer::Strategies::Docker < KuberKit::ServiceDeployer:
|
|
6
6
|
]
|
7
7
|
|
8
8
|
STRATEGY_OPTIONS = [
|
9
|
+
:namespace,
|
9
10
|
:container_name,
|
11
|
+
:env_file,
|
10
12
|
:image_name,
|
11
13
|
:detached,
|
12
14
|
:command_name,
|
@@ -14,6 +16,8 @@ class KuberKit::ServiceDeployer::Strategies::Docker < KuberKit::ServiceDeployer:
|
|
14
16
|
:delete_if_exists,
|
15
17
|
:volumes,
|
16
18
|
:networks,
|
19
|
+
:expose,
|
20
|
+
:publish,
|
17
21
|
]
|
18
22
|
|
19
23
|
Contract KuberKit::Shell::AbstractShell, KuberKit::Core::Service => Any
|
@@ -24,11 +28,15 @@ class KuberKit::ServiceDeployer::Strategies::Docker < KuberKit::ServiceDeployer:
|
|
24
28
|
raise KuberKit::Error, "Unknow options for deploy strategy: #{unknown_options}. Available options: #{STRATEGY_OPTIONS}"
|
25
29
|
end
|
26
30
|
|
27
|
-
|
31
|
+
namespace = strategy_options.fetch(:namespace, nil)
|
32
|
+
container_name = strategy_options.fetch(:container_name, [namespace, service.name].compact.join("_"))
|
28
33
|
command_name = strategy_options.fetch(:command_name, nil)
|
34
|
+
env_file = strategy_options.fetch(:env_file, nil)
|
29
35
|
custom_args = strategy_options.fetch(:custom_args, nil)
|
30
36
|
networks = strategy_options.fetch(:networks, [])
|
31
37
|
volumes = strategy_options.fetch(:volumes, [])
|
38
|
+
expose_ports = strategy_options.fetch(:expose, [])
|
39
|
+
publish_ports = strategy_options.fetch(:publish, [])
|
32
40
|
hostname = strategy_options.fetch(:hostname, container_name)
|
33
41
|
|
34
42
|
image_name = strategy_options.fetch(:image_name, nil)
|
@@ -46,6 +54,9 @@ class KuberKit::ServiceDeployer::Strategies::Docker < KuberKit::ServiceDeployer:
|
|
46
54
|
if container_name
|
47
55
|
custom_args << "--name #{container_name}"
|
48
56
|
end
|
57
|
+
if env_file
|
58
|
+
custom_args << "--env-file #{env_file}"
|
59
|
+
end
|
49
60
|
if hostname
|
50
61
|
custom_args << "--hostname #{hostname}"
|
51
62
|
end
|
@@ -58,6 +69,12 @@ class KuberKit::ServiceDeployer::Strategies::Docker < KuberKit::ServiceDeployer:
|
|
58
69
|
docker_commands.create_volume(shell, volume_name) unless volume_name.start_with?("/")
|
59
70
|
custom_args << "--volume #{volume}"
|
60
71
|
end
|
72
|
+
Array(expose_ports).each do |expose_port|
|
73
|
+
custom_args << "--expose #{expose_port}"
|
74
|
+
end
|
75
|
+
Array(publish_ports).each do |publish_port|
|
76
|
+
custom_args << "--publish #{publish_port}"
|
77
|
+
end
|
61
78
|
|
62
79
|
docker_commands.run(
|
63
80
|
shell, image.remote_registry_url,
|
data/lib/kuber_kit/version.rb
CHANGED