kuber_kit 0.1.7 → 0.1.8
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/example/services/env_file.rb +4 -1
- data/lib/kuber_kit/actions/configuration_loader.rb +2 -0
- data/lib/kuber_kit/actions/env_file_reader.rb +2 -0
- data/lib/kuber_kit/actions/image_compiler.rb +2 -0
- data/lib/kuber_kit/actions/kubectl_applier.rb +2 -0
- data/lib/kuber_kit/actions/service_deployer.rb +2 -0
- data/lib/kuber_kit/actions/service_reader.rb +2 -0
- data/lib/kuber_kit/actions/template_reader.rb +2 -0
- data/lib/kuber_kit/core/artifacts/artifact_store.rb +8 -0
- data/lib/kuber_kit/core/context_helper/service_helper.rb +2 -2
- data/lib/kuber_kit/core/service.rb +6 -2
- data/lib/kuber_kit/core/templates/template_store.rb +8 -0
- data/lib/kuber_kit/service_deployer/strategies/kubernetes.rb +6 -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: 37500e0f3feb9e241251e04ae72ed0cc618d5dadf3e1c660a05658a0e5fefa15
|
4
|
+
data.tar.gz: 82d7c67f5f421fed5cbb94f14ad153dcb6f6f2f068817ffd518f6c0ea7cfe3f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63c544b4ee93bf01f7d36720effff85052643583b008d68327c10bcbceb5711bce976856da1e6c56c9f877720eb2735447574e534f9f97a966777156ee01bda3
|
7
|
+
data.tar.gz: d388233a8636e884ee033971bf8365f3b5e753dc43a22b5e03702dda764e0632003dc80448fd7a9f3378e98539e06bc25f8163dcd6c85fdd67afddba2f141c80
|
data/Gemfile.lock
CHANGED
@@ -50,6 +50,8 @@ class KuberKit::Actions::ConfigurationLoader
|
|
50
50
|
files = service_store.load_definitions(services_path)
|
51
51
|
task.update_title("Loaded #{files.count} service definitions")
|
52
52
|
end
|
53
|
+
rescue KuberKit::Error => e
|
54
|
+
ui.print_error("Error", e.message)
|
53
55
|
end
|
54
56
|
|
55
57
|
def load_configurations(configurations_path, configuration_name)
|
@@ -11,5 +11,7 @@ class KuberKit::Actions::EnvFileReader
|
|
11
11
|
def call(env_file_name, options)
|
12
12
|
result = env_file_reader.call(local_shell, env_file_name)
|
13
13
|
ui.print_info(env_file_name.to_s, JSON.pretty_generate(result))
|
14
|
+
rescue KuberKit::Error => e
|
15
|
+
ui.print_error("Error", e.message)
|
14
16
|
end
|
15
17
|
end
|
@@ -17,7 +17,7 @@ class KuberKit::Core::ContextHelper::ServiceHelper < KuberKit::Core::ContextHelp
|
|
17
17
|
@service.uri
|
18
18
|
end
|
19
19
|
|
20
|
-
def attribute(attribute_name)
|
21
|
-
@service.attribute(attribute_name)
|
20
|
+
def attribute(attribute_name, default: nil)
|
21
|
+
@service.attribute(attribute_name, default: default)
|
22
22
|
end
|
23
23
|
end
|
@@ -22,11 +22,15 @@ class KuberKit::Core::Service
|
|
22
22
|
name.to_s.gsub("_", "-")
|
23
23
|
end
|
24
24
|
|
25
|
-
def attribute(attribute_name)
|
26
|
-
|
25
|
+
def attribute(attribute_name, default: nil)
|
26
|
+
if !attributes.has_key?(attribute_name.to_sym) && default.nil?
|
27
27
|
raise AttributeNotSet, "attribute #{attribute_name} was not set"
|
28
28
|
end
|
29
29
|
|
30
|
+
if !attributes.has_key?(attribute_name.to_sym) && !default.nil?
|
31
|
+
return default
|
32
|
+
end
|
33
|
+
|
30
34
|
attributes[attribute_name.to_sym]
|
31
35
|
end
|
32
36
|
end
|
@@ -13,6 +13,11 @@ class KuberKit::ServiceDeployer::Strategies::Kubernetes < KuberKit::ServiceDeplo
|
|
13
13
|
|
14
14
|
kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
|
15
15
|
kubectl_commands.apply_file(shell, config_path, kubeconfig_path: kubeconfig_path)
|
16
|
-
|
16
|
+
|
17
|
+
deployment_restart_enabled = service.attribute(:deployment_restart_enabled, default: true)
|
18
|
+
deployment_restart_name = service.attribute(:deployment_restart_name, default: service.uri)
|
19
|
+
if deployment_restart_enabled
|
20
|
+
kubectl_commands.rolling_restart(shell, deployment_restart_name, kubeconfig_path: kubeconfig_path)
|
21
|
+
end
|
17
22
|
end
|
18
23
|
end
|
data/lib/kuber_kit/version.rb
CHANGED