kuber_kit 0.1.0 → 0.1.1

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: a9ac91299a59af0f2eec1d7382f3b55f0946931e1d4f87de909d76631242f441
4
- data.tar.gz: d0737d6d217a9c4107fb77536fd36e2c3d59e71adb9dd8c68b6dbc2c12e2eb8f
3
+ metadata.gz: 0635a0f1e358b5f29f44badbd6571e0a54c98f16072656c5edb8a19769c7bd92
4
+ data.tar.gz: 3c81a6c67d14c5ca7852a856c10e3acb22b57cac835ad26a922c020609e57ea1
5
5
  SHA512:
6
- metadata.gz: d9feedc39ab9959d1a3e4bd38a5b6703f6d93f16d03bbd4805732166266e64c4dc9798d6e5d173de2e5058f1ccfc8ad86143c793916efd9936768279eedff14f
7
- data.tar.gz: a9bf6386c3bac7c75c894f82464af2e9e83dd94e56dec4be9da87fd092c81e9cbff568c4432921ff601c11831127f497651beb835d21edc8379675dffc6c0e1a
6
+ metadata.gz: 0aa582e58931303efe8a60dfebaa4f1550d3e7f962ac6b1d758ff5398ffc2d61c31288699b931e0127720ff67d8e9de750ea005758282539fb6f37d15509abb6
7
+ data.tar.gz: d676378c03ce31d7812edb3c760cbc5b99df7daf54de7109485691634dd173c55ced342c3c87a77ee6fc6e2b969b7d505b950b0fd62cb29dbe7d321d56867fef
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kuber_kit (0.1.0)
4
+ kuber_kit (0.1.1)
5
5
  cli-ui
6
6
  contracts-lite
7
7
  dry-auto_inject
@@ -2,6 +2,7 @@ class KuberKit::Actions::ConfigurationLoader
2
2
  include KuberKit::Import[
3
3
  "core.registry_store",
4
4
  "core.image_store",
5
+ "core.service_store",
5
6
  "core.configuration_store",
6
7
  "artifacts_sync.artifacts_updater",
7
8
  "tools.logger",
@@ -12,15 +13,17 @@ class KuberKit::Actions::ConfigurationLoader
12
13
 
13
14
  Contract Hash => Any
14
15
  def call(options)
15
- root_path = options[:path] || File.join(Dir.pwd, configs.kuber_kit_dirname)
16
- images_path = options[:images_path] || File.join(root_path, configs.images_dirname)
17
- infra_path = options[:infra_path] || File.join(root_path, configs.infra_dirname)
16
+ root_path = options[:path] || File.join(Dir.pwd, configs.kuber_kit_dirname)
17
+ images_path = options[:images_path] || File.join(root_path, configs.images_dirname)
18
+ services_path = options[:services_path] || File.join(root_path, configs.services_dirname)
19
+ infra_path = options[:infra_path] || File.join(root_path, configs.infra_dirname)
18
20
  configurations_path = options[:configurations_path] || File.join(root_path, configs.configurations_dirname)
19
21
  configuration_name = options[:configuration]
20
22
 
21
23
  logger.info "Launching kuber_kit with:"
22
24
  logger.info " Root path: #{root_path.to_s.yellow}"
23
25
  logger.info " Images path: #{images_path.to_s.yellow}"
26
+ logger.info " Services path: #{services_path.to_s.yellow}"
24
27
  logger.info " Infrastructure path: #{infra_path.to_s.yellow}"
25
28
  logger.info " Configurations path: #{configurations_path.to_s.yellow}"
26
29
  logger.info " Configuration name: #{configuration_name.to_s.yellow}"
@@ -42,6 +45,11 @@ class KuberKit::Actions::ConfigurationLoader
42
45
  files = image_store.load_definitions(images_path)
43
46
  task.update_title("Loaded #{files.count} image definitions")
44
47
  end
48
+
49
+ ui.create_task("Loading service definitions") do |task|
50
+ files = service_store.load_definitions(services_path)
51
+ task.update_title("Loaded #{files.count} service definitions")
52
+ end
45
53
  end
46
54
 
47
55
  def load_configurations(configurations_path, configuration_name)
@@ -14,8 +14,9 @@ class KuberKit::Configs
14
14
  'tmp',
15
15
  'logs'
16
16
  ]
17
- INDOCKER_DIRNAME = "kuber_kit".freeze
17
+ KUBER_KIT_DIRNAME = "kuber_kit".freeze
18
18
  IMAGES_DIRNAME = "images".freeze
19
+ SERVICES_DIRNAME = "services".freeze
19
20
  INFRA_DIRNAME = "infrastructure".freeze
20
21
  CONFIGURATIONS_DIRNAME = "configurations".freeze
21
22
  ARTIFACT_CLONE_DIR = "/tmp/kuber_kit/artifacts"
@@ -23,7 +24,7 @@ class KuberKit::Configs
23
24
 
24
25
  attr_accessor :image_dockerfile_name, :image_build_context_dir, :image_tag,
25
26
  :docker_ignore_list, :image_compile_dir,
26
- :kuber_kit_dirname, :images_dirname, :infra_dirname, :configurations_dirname,
27
+ :kuber_kit_dirname, :images_dirname, :services_dirname, :infra_dirname, :configurations_dirname,
27
28
  :artifact_clone_dir, :service_config_dir
28
29
 
29
30
  def initialize
@@ -32,8 +33,9 @@ class KuberKit::Configs
32
33
  @image_tag = IMAGE_TAG
33
34
  @image_compile_dir = IMAGE_COMPILE_DIR
34
35
  @docker_ignore_list = DOCKER_IGNORE_LIST
35
- @kuber_kit_dirname = INDOCKER_DIRNAME
36
+ @kuber_kit_dirname = KUBER_KIT_DIRNAME
36
37
  @images_dirname = IMAGES_DIRNAME
38
+ @services_dirname = SERVICES_DIRNAME
37
39
  @infra_dirname = INFRA_DIRNAME
38
40
  @configurations_dirname = CONFIGURATIONS_DIRNAME
39
41
  @artifact_clone_dir = ARTIFACT_CLONE_DIR
@@ -5,7 +5,8 @@ class KuberKit::Core::ServiceStore
5
5
  include KuberKit::Import[
6
6
  "core.service_factory",
7
7
  "core.service_definition_factory",
8
- "shell.local_shell"
8
+ "shell.local_shell",
9
+ "tools.logger"
9
10
  ]
10
11
 
11
12
  def define(service_name)
@@ -44,6 +45,9 @@ class KuberKit::Core::ServiceStore
44
45
  files = local_shell.recursive_list_files(dir_path, name: "*.rb").each do |path|
45
46
  load_definition(path)
46
47
  end
48
+ rescue KuberKit::Shell::AbstractShell::DirNotFoundError
49
+ logger.warn("Directory with services not found: #{dir_path}")
50
+ []
47
51
  end
48
52
 
49
53
  def load_definition(file_path)
@@ -1,3 +1,3 @@
1
1
  module KuberKit
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Khaziev
@@ -162,8 +162,8 @@ files:
162
162
  - example/infrastructure/artifacts.rb
163
163
  - example/infrastructure/env_files.rb
164
164
  - example/infrastructure/registries.rb
165
- - example/infrastructure/services.rb
166
165
  - example/infrastructure/templates.rb
166
+ - example/services/auth_app.rb
167
167
  - kuber_kit.gemspec
168
168
  - lib/kuber_kit.rb
169
169
  - lib/kuber_kit/actions/configuration_loader.rb