kuber_kit 0.1.1 → 0.1.2

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: 0635a0f1e358b5f29f44badbd6571e0a54c98f16072656c5edb8a19769c7bd92
4
- data.tar.gz: 3c81a6c67d14c5ca7852a856c10e3acb22b57cac835ad26a922c020609e57ea1
3
+ metadata.gz: 20a7ebca76e47e6820df5cf6781c3d890f5a019f86d68b18220886820e2ba1dc
4
+ data.tar.gz: 6998805195d116612b2db4c56b519ba030b80ab942e4260f0fde23033833a5ec
5
5
  SHA512:
6
- metadata.gz: 0aa582e58931303efe8a60dfebaa4f1550d3e7f962ac6b1d758ff5398ffc2d61c31288699b931e0127720ff67d8e9de750ea005758282539fb6f37d15509abb6
7
- data.tar.gz: d676378c03ce31d7812edb3c760cbc5b99df7daf54de7109485691634dd173c55ced342c3c87a77ee6fc6e2b969b7d505b950b0fd62cb29dbe7d321d56867fef
6
+ metadata.gz: 8271032fa486583c67cf83eea3a1d19a6796ea7667fad1e46f534ba4dc93457276be0df5070af131e44879a8d9dfcc6c0baf06bbbd9909c70000e60f816b79ae
7
+ data.tar.gz: ae36ec4cd5163f7ddd9394d56069200fac1fb60d7775e67f533ff639a0fe24098e92e07387727289f6b4d24f97656bdee7c1b9ec694b0ebf128734ec1107783a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kuber_kit (0.1.1)
4
+ kuber_kit (0.1.2)
5
5
  cli-ui
6
6
  contracts-lite
7
7
  dry-auto_inject
data/TODO.md CHANGED
@@ -1,2 +1,3 @@
1
+ - service factory should make sure that service exists
1
2
  - add build servers support
2
3
  - add build vars support (use images instead of containers)
@@ -115,8 +115,8 @@ module KuberKit
115
115
  end
116
116
 
117
117
  module ServiceDeployer
118
+ autoload :Deployer, 'service_deployer/deployer'
118
119
  autoload :ServiceReader, 'service_deployer/service_reader'
119
- autoload :ServiceApplier, 'service_deployer/service_applier'
120
120
  autoload :ServiceListResolver, 'service_deployer/service_list_resolver'
121
121
  end
122
122
 
@@ -125,7 +125,7 @@ module KuberKit
125
125
  autoload :EnvFileReader, 'actions/env_file_reader'
126
126
  autoload :TemplateReader, 'actions/template_reader'
127
127
  autoload :ServiceReader, 'actions/service_reader'
128
- autoload :ServiceApplier, 'actions/service_applier'
128
+ autoload :ServiceDeployer, 'actions/service_deployer'
129
129
  autoload :ConfigurationLoader, 'actions/configuration_loader'
130
130
  autoload :KubectlApplier, 'actions/kubectl_applier'
131
131
  end
@@ -43,7 +43,7 @@ class KuberKit::Actions::ImageCompiler
43
43
 
44
44
  def compile_image(image_name, build_id)
45
45
  compile_dir = generate_compile_dir(build_id: build_id)
46
- image_compiler.compile(local_shell, image_name, compile_dir)
46
+ compiler.compile(local_shell, image_name, compile_dir)
47
47
  end
48
48
 
49
49
  def generate_build_id
@@ -0,0 +1,22 @@
1
+ class KuberKit::Actions::ServiceDeployer
2
+ include KuberKit::Import[
3
+ "service_deployer.service_list_resolver",
4
+ "service_deployer.deployer",
5
+ "shell.local_shell",
6
+ "ui"
7
+ ]
8
+
9
+ Contract KeywordArgs[
10
+ services: Maybe[ArrayOf[String]],
11
+ tags: Maybe[ArrayOf[String]],
12
+ ] => Any
13
+ def call(services:, tags:)
14
+ service_names = service_list_resolver.resolve(
15
+ services: services || [],
16
+ tags: tags || []
17
+ )
18
+ service_names.each do |service_name|
19
+ deployer.deploy(local_shell, service_name.to_sym)
20
+ end
21
+ end
22
+ end
@@ -63,7 +63,7 @@ class KuberKit::CLI < Thor
63
63
 
64
64
  KuberKit::Container['actions.configuration_loader'].call(options)
65
65
 
66
- KuberKit::Container['actions.service_applier'].call(services: options[:services], tags: options[:tags])
66
+ KuberKit::Container['actions.service_deployer'].call(services: options[:services], tags: options[:tags])
67
67
  end
68
68
 
69
69
  def self.exit_on_failure?
@@ -17,8 +17,8 @@ class KuberKit::Container
17
17
  KuberKit::Actions::ServiceReader.new
18
18
  end
19
19
 
20
- register "actions.service_applier" do
21
- KuberKit::Actions::ServiceApplier.new
20
+ register "actions.service_deployer" do
21
+ KuberKit::Actions::ServiceDeployer.new
22
22
  end
23
23
 
24
24
  register "actions.configuration_loader" do
@@ -189,6 +189,10 @@ class KuberKit::Container
189
189
  KuberKit::TemplateReader::ArtifactFileReader.new
190
190
  end
191
191
 
192
+ register "service_deployer.deployer" do
193
+ KuberKit::ServiceDeployer::Deployer.new
194
+ end
195
+
192
196
  register "service_deployer.service_reader" do
193
197
  KuberKit::ServiceDeployer::ServiceReader.new
194
198
  end
@@ -0,0 +1,19 @@
1
+ class KuberKit::ServiceDeployer::Deployer
2
+ include KuberKit::Import[
3
+ "core.service_store",
4
+ "service_deployer.service_reader",
5
+ "shell.kubectl_commands",
6
+ "configs",
7
+ ]
8
+
9
+ def deploy(shell, service_name)
10
+ service = service_store.get_service(service_name)
11
+ kubecfg_path = KuberKit.current_configuration.kubecfg_path
12
+
13
+ result = service_reader.read(shell, service)
14
+ file_path = "#{configs.service_config_dir}/#{service.name}.yml"
15
+ shell.write(file_path, result)
16
+
17
+ kubectl_commands.apply_file(shell, file_path, kubecfg_path: kubecfg_path)
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module KuberKit
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuber_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Khaziev
@@ -170,7 +170,7 @@ files:
170
170
  - lib/kuber_kit/actions/env_file_reader.rb
171
171
  - lib/kuber_kit/actions/image_compiler.rb
172
172
  - lib/kuber_kit/actions/kubectl_applier.rb
173
- - lib/kuber_kit/actions/service_applier.rb
173
+ - lib/kuber_kit/actions/service_deployer.rb
174
174
  - lib/kuber_kit/actions/service_reader.rb
175
175
  - lib/kuber_kit/actions/template_reader.rb
176
176
  - lib/kuber_kit/artifacts_sync/abstract_artifact_resolver.rb
@@ -227,6 +227,7 @@ files:
227
227
  - lib/kuber_kit/preprocessing/dir_preprocessor.rb
228
228
  - lib/kuber_kit/preprocessing/file_preprocessor.rb
229
229
  - lib/kuber_kit/preprocessing/text_preprocessor.rb
230
+ - lib/kuber_kit/service_deployer/deployer.rb
230
231
  - lib/kuber_kit/service_deployer/service_list_resolver.rb
231
232
  - lib/kuber_kit/service_deployer/service_reader.rb
232
233
  - lib/kuber_kit/shell/abstract_shell.rb
@@ -1,39 +0,0 @@
1
- class KuberKit::Actions::ServiceApplier
2
- include KuberKit::Import[
3
- "core.service_store",
4
- "service_deployer.service_reader",
5
- "service_deployer.service_list_resolver",
6
- "shell.local_shell",
7
- "shell.kubectl_commands",
8
- "configs",
9
- "ui"
10
- ]
11
-
12
- Contract KeywordArgs[
13
- services: Maybe[ArrayOf[String]],
14
- tags: Maybe[ArrayOf[String]],
15
- ] => Any
16
- def call(services:, tags:)
17
- service_names = service_list_resolver.resolve(
18
- services: services || [],
19
- tags: tags || []
20
- )
21
- service_names.each do |service_name|
22
- apply_service(service_name.to_sym)
23
- end
24
- end
25
-
26
- def apply_service(service_name)
27
- service = service_store.get_service(service_name)
28
- kubecfg_path = KuberKit.current_configuration.kubecfg_path
29
-
30
- result = service_reader.read(local_shell, service)
31
- file_path = "#{configs.service_config_dir}/#{service.name}.yml"
32
- local_shell.write(file_path, result)
33
-
34
- ui.create_task("Applying file: #{file_path}") do |task|
35
- kubectl_commands.apply_file(local_shell, file_path, kubecfg_path: kubecfg_path)
36
- task.update_title("Applied file: #{file_path}")
37
- end
38
- end
39
- end