kuber_kit 0.8.3 → 0.8.4

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: b69eac4e6129cfa8a312b6066fc9d1a8164885928880add9c170ebb1a8914519
4
- data.tar.gz: a38ea5783826d7366cf03eb6722132a9a1167b6a418d94d8be2442571f760d1a
3
+ metadata.gz: 15dac677730506e10fbb09705224f68c82e625a389bfbbab92f0292d26599ebb
4
+ data.tar.gz: '09d78c4155e4b625935b263969a21361093100b004da34741a671f579f79450f'
5
5
  SHA512:
6
- metadata.gz: bdb45aac937ba742197e8d5686ea18253fc0cb6093291bc34bc026b3a60f212cd347b9b54c16640561f33dc8e687e96f234b581402833604d26883ac852b3889
7
- data.tar.gz: 337c593fd7826908f5b388829844ee0220e3851fb8117313afcd83f4ebd54b5cfac7747a4da497b6873eb995bc8d3d80a88776e845c5c45398b24ac4fc16b642
6
+ metadata.gz: e82d1c7dfd78ecea8b00939ca04f75c189ac336f84f69b811613db6e272a821c66202cf882081344cd920153f00f99d5c74ebe2962b771619361380fed076a4b
7
+ data.tar.gz: af22dfcb438f9862adcbd4165ddf608c0db0c4580d7ae5b3a0b810d83193ce6caeb28a40671d58d4f064876058ae4a8503350c47a7e5ccc9f3efe1bcd06fc4b8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ **0.8.4**
2
+ - Added initial services support, to deploy before all other servies
3
+
1
4
  **0.8.3**
2
5
  - Always load artifacts, if kubeconfig is an artifact
3
6
 
@@ -28,9 +28,10 @@ class KuberKit::Actions::ServiceDeployer
28
28
  services, tags = deployment_options_selector.call()
29
29
  end
30
30
 
31
- default_services = current_configuration.default_services.map(&:to_s)
32
31
  disabled_services = current_configuration.disabled_services.map(&:to_s)
33
32
  disabled_services += skip_services if skip_services
33
+ default_services = current_configuration.default_services.map(&:to_s) - disabled_services
34
+ initial_services = current_configuration.initial_services.map(&:to_s) - disabled_services
34
35
 
35
36
  service_names = service_list_resolver.resolve(
36
37
  services: services || [],
@@ -64,9 +65,20 @@ class KuberKit::Actions::ServiceDeployer
64
65
  return false unless compilation_result && compilation_result.succeeded?
65
66
  end
66
67
 
68
+ # First deploy initial services.
69
+ # This feature is used to deploy some services, required for deployment of other services, e.g. env files
70
+ # Note: Initial services are deployed without dependencies
71
+ initial_services.map(&:to_sym).each_slice(configs.deploy_simultaneous_limit) do |batch_service_names|
72
+ ui.print_debug("ServiceDeployer", "Scheduling to compile: #{batch_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
73
+
74
+ if deployment_result.succeeded?
75
+ deploy_simultaneously(batch_service_names, deployment_result)
76
+ end
77
+ end
78
+
67
79
  if skip_dependencies
68
80
  service_names.each_slice(configs.deploy_simultaneous_limit) do |batch_service_names|
69
- ui.print_debug("ServiceDeployer", "Scheduling to compile: #{batch_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
81
+ ui.print_debug("ServiceDeployer", "Scheduling to deploy: #{batch_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
70
82
 
71
83
  if deployment_result.succeeded?
72
84
  deploy_simultaneously(batch_service_names, deployment_result)
@@ -74,7 +86,7 @@ class KuberKit::Actions::ServiceDeployer
74
86
  end
75
87
  else
76
88
  service_dependency_resolver.each_with_deps(service_names) do |dep_service_names|
77
- ui.print_debug("ServiceDeployer", "Scheduling to compile: #{dep_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
89
+ ui.print_debug("ServiceDeployer", "Scheduling to deploy: #{dep_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
78
90
 
79
91
  if deployment_result.succeeded?
80
92
  deploy_simultaneously(dep_service_names, deployment_result)
@@ -1,7 +1,7 @@
1
1
  class KuberKit::Core::Configuration
2
2
  attr_reader :name, :artifacts, :registries, :env_files, :templates, :kubeconfig_path,
3
- :services_attributes, :enabled_services, :disabled_services, :default_services,
4
- :build_servers, :global_build_vars,
3
+ :services_attributes, :enabled_services, :disabled_services, :default_services,
4
+ :initial_services, :build_servers, :global_build_vars,
5
5
  :deployer_strategy, :deployer_namespace, :deployer_require_confirmation
6
6
 
7
7
  Contract KeywordArgs[
@@ -15,6 +15,7 @@ class KuberKit::Core::Configuration
15
15
  enabled_services: ArrayOf[Symbol],
16
16
  disabled_services: ArrayOf[Symbol],
17
17
  default_services: ArrayOf[Symbol],
18
+ initial_services: ArrayOf[Symbol],
18
19
  build_servers: ArrayOf[KuberKit::Core::BuildServers::AbstractBuildServer],
19
20
  global_build_vars: HashOf[Symbol => Any],
20
21
  deployer_strategy: Symbol,
@@ -23,7 +24,7 @@ class KuberKit::Core::Configuration
23
24
  ] => Any
24
25
  def initialize(name:, artifacts:, registries:, env_files:, templates:, kubeconfig_path:,
25
26
  services_attributes:, enabled_services:, disabled_services:, default_services:,
26
- build_servers:, global_build_vars:,
27
+ initial_services:, build_servers:, global_build_vars:,
27
28
  deployer_strategy:, deployer_namespace:, deployer_require_confirmation:)
28
29
  @name = name
29
30
  @artifacts = artifacts
@@ -36,6 +37,7 @@ class KuberKit::Core::Configuration
36
37
  @enabled_services = enabled_services
37
38
  @disabled_services = disabled_services
38
39
  @default_services = default_services
40
+ @initial_services = initial_services
39
41
  @global_build_vars = global_build_vars
40
42
  @deployer_strategy = deployer_strategy
41
43
  @deployer_namespace = deployer_namespace
@@ -14,6 +14,7 @@ class KuberKit::Core::ConfigurationDefinition
14
14
  @enabled_services = []
15
15
  @disabled_services = []
16
16
  @default_services = []
17
+ @initial_services = []
17
18
  @services_attributes = {}
18
19
  end
19
20
 
@@ -28,6 +29,7 @@ class KuberKit::Core::ConfigurationDefinition
28
29
  enabled_services: @enabled_services,
29
30
  disabled_services: @disabled_services,
30
31
  default_services: @default_services,
32
+ initial_services: @initial_services,
31
33
  build_servers: @build_servers,
32
34
  services_attributes: @services_attributes,
33
35
  global_build_vars: @global_build_vars,
@@ -126,6 +128,11 @@ class KuberKit::Core::ConfigurationDefinition
126
128
  return self
127
129
  end
128
130
 
131
+ def initial_services(services)
132
+ @initial_services += services.map(&:to_sym)
133
+ return self
134
+ end
135
+
129
136
  def disabled_services(services)
130
137
  @disabled_services += services.map(&:to_sym)
131
138
  return self
@@ -31,6 +31,7 @@ class KuberKit::Core::ConfigurationFactory
31
31
  enabled_services: configuration_attrs.enabled_services,
32
32
  disabled_services: configuration_attrs.disabled_services,
33
33
  default_services: configuration_attrs.default_services,
34
+ initial_services: configuration_attrs.initial_services,
34
35
  global_build_vars: configuration_attrs.global_build_vars || {},
35
36
  deployer_strategy: configuration_attrs.deployer_strategy || configs.deployer_strategy,
36
37
  deployer_namespace: configuration_attrs.deployer_namespace,
@@ -1,3 +1,3 @@
1
1
  module KuberKit
2
- VERSION = "0.8.3"
2
+ VERSION = "0.8.4"
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.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Khaziev