kuber_kit 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88cc2d5d20c0f1bc958f8ecd8682ff66069cd95867b44e717c29adde0378c0c2
4
- data.tar.gz: a3ebb9fd30393f45fab0f0ddfcd6aa8569777655a6a407bfe4df653b94e31123
3
+ metadata.gz: f32cf040d33941d931b9e5fa2f67c8132f6538e4301f2f533531e2524410ee91
4
+ data.tar.gz: 2f769ec987b79ad51f594237968698515fea823cefdc0382d2631e3f7b0abbc0
5
5
  SHA512:
6
- metadata.gz: 275c26b658b4f0739a364bbbc58e1ec03bc45bbeeb7d4dec8988ff8f2f7c598ef43e96a15991f0201c271259380a3949b48dccd6f5f3ab6a88c541f3f38f5a68
7
- data.tar.gz: 7f3780629d0836443d20914551b427ce557e35f336c7640a4da6c70eee0380616a4fbeefab23154306254bf6c86693f44388c527ed7e2490139f5210353a2357
6
+ metadata.gz: c7f532ee9af8a02191d4a895f30647fb7d30abf63573e93b3616ee17adb657ed6f220ac0fc79a8b2a1bdc2a7f542bfc341937ef631835f0e2c4534505ce38b55
7
+ data.tar.gz: 24f8f053b3ef45ab3dc277d6d255b9334f4afa3c68490df1dd47f4fc2198aaf4b53584eb06040319e5cd87822b179d979ebaf1e7a4f9a36cf7d92170be28d5e5
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kuber_kit (0.2.4)
4
+ kuber_kit (0.2.5)
5
5
  cli-ui
6
6
  contracts-lite
7
7
  dry-auto_inject
@@ -141,6 +141,7 @@ module KuberKit
141
141
  module Strategies
142
142
  autoload :Abstract, 'service_deployer/strategies/abstract'
143
143
  autoload :Kubernetes, 'service_deployer/strategies/kubernetes'
144
+ autoload :KubernetesRunner, 'service_deployer/strategies/kubernetes_runner'
144
145
  end
145
146
  end
146
147
 
@@ -0,0 +1,27 @@
1
+ class KuberKit::ServiceDeployer::Strategies::KubernetesRunner < KuberKit::ServiceDeployer::Strategies::Abstract
2
+ include KuberKit::Import[
3
+ "service_reader.reader",
4
+ "shell.kubectl_commands",
5
+ "configs",
6
+ ]
7
+
8
+ Contract KuberKit::Shell::AbstractShell, KuberKit::Core::Service => Any
9
+ def deploy(shell, service)
10
+ service_config = reader.read(shell, service)
11
+ config_path = "#{configs.service_config_dir}/#{service.name}.yml"
12
+ shell.write(config_path, service_config)
13
+
14
+ kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
15
+ deploy_namespace = KuberKit.current_configuration.deploy_namespace
16
+
17
+ deployment_resource_name = service.attribute(:deployment_resource_name, default: service.uri)
18
+ deployment_resource_type = service.attribute(:deployment_resource_type, default: "job")
19
+
20
+ deployment_delete_enabled = service.attribute(:deployment_delete_enabled, default: true)
21
+ if deployment_delete_enabled
22
+ kubectl_commands.delete_resource(shell, deployment_resource_type, deployment_resource_name, kubeconfig_path: kubeconfig_path, namespace: deploy_namespace)
23
+ end
24
+
25
+ kubectl_commands.apply_file(shell, config_path, kubeconfig_path: kubeconfig_path, namespace: deploy_namespace)
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module KuberKit
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuber_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Khaziev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-01 00:00:00.000000000 Z
11
+ date: 2020-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contracts-lite
@@ -257,6 +257,7 @@ files:
257
257
  - lib/kuber_kit/service_deployer/service_list_resolver.rb
258
258
  - lib/kuber_kit/service_deployer/strategies/abstract.rb
259
259
  - lib/kuber_kit/service_deployer/strategies/kubernetes.rb
260
+ - lib/kuber_kit/service_deployer/strategies/kubernetes_runner.rb
260
261
  - lib/kuber_kit/service_deployer/strategy_detector.rb
261
262
  - lib/kuber_kit/service_reader/action_handler.rb
262
263
  - lib/kuber_kit/service_reader/reader.rb