kuber_kit 1.1.2 → 1.1.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: e8c0e83354ec30de497af66249d04c6215dd969e72cb53e81ebcf3865f3c4aee
4
- data.tar.gz: a3e2cc808700f3ffb3409cf06966fe1a145762cf0b6d992846b9f8a91cc9b2a4
3
+ metadata.gz: b70bdef220e67c9789122ab7eb7ee064dff475174ec1e497b0baf11566da6e1f
4
+ data.tar.gz: 004b9a6c4e8265f1f3f498b1b42fa35a0447567ef428abef4b571cce635c0cd9
5
5
  SHA512:
6
- metadata.gz: 937fcf8e351cd6177c5768e6be21dc8c25a4aa4e677a182ae448f4c5838cd5d67cce664b79aefce434ca305796368e3e5c2d103eb84de15ad0340402e8ffbbfe
7
- data.tar.gz: 6fd5a04bb20c18e052256e7747b32d3eb78b68ac69e70897f6794c93f96ecb1f3fdbb232dd9dff1650c1580e298ee3529dd016b70bff3f2e4f27ec1713882256
6
+ metadata.gz: 1e60b51c8108814fc41f89b41a28732e59a8f5bddb938ee94d8cb765ccc5f2ea3de260aed0a52a212649389814884c40734c7f60fe77502e78e3814821c31790
7
+ data.tar.gz: 5f165249b8d91cd8bc148f9cc5f3a3a9a57402355c371b30f7f8511fcb6bf8d0650a7ba7a08c072dcba550837e52aced3a1d9cec4959be98c18d5b526678fb29
data/README.md CHANGED
@@ -19,7 +19,7 @@ Please install specific kuber_kit version, depending on Ruby version.
19
19
  | Ruby Version | KuberKit Version |
20
20
  | ------------ | ------------ |
21
21
  | 2.6 | 1.0.1 |
22
- | 2.7 | 1.1.2 |
22
+ | 2.7 | 1.1.4 |
23
23
 
24
24
  ## Usage
25
25
 
@@ -84,6 +84,10 @@ class KuberKit::Actions::ConfigurationLoader
84
84
  configuration_name = first_configurations.configuration_name
85
85
  end
86
86
 
87
+ if configuration_store.count > 1 && configuration_name
88
+ ui.print_info("Configuration", "Using configuration: #{configuration_name.to_s.cyan}")
89
+ end
90
+
87
91
  if configuration_store.count > 1 && configuration_name.nil?
88
92
  options = all_configurations.map(&:configuration_name).map(&:to_s)
89
93
  configuration_name = ui.prompt("Please select configuration name (or set it using -C option)", options)
@@ -18,9 +18,10 @@ class KuberKit::Actions::ServiceDeployer
18
18
  skip_services: Maybe[ArrayOf[String]],
19
19
  skip_compile: Maybe[Bool],
20
20
  skip_dependencies: Maybe[Bool],
21
+ skip_deployment: Maybe[Bool],
21
22
  require_confirmation: Maybe[Bool],
22
23
  ] => Any
23
- def call(services:, tags:, skip_services: nil, skip_compile: false, skip_dependencies: false, require_confirmation: false)
24
+ def call(services:, tags:, skip_services: nil, skip_compile: false, skip_dependencies: false, skip_deployment: false, require_confirmation: false)
24
25
  deployment_result = KuberKit::Actions::ActionResult.new()
25
26
  current_configuration = KuberKit.current_configuration
26
27
 
@@ -66,6 +67,11 @@ class KuberKit::Actions::ServiceDeployer
66
67
  return false unless compilation_result && compilation_result.succeeded?
67
68
  end
68
69
 
70
+ # Skip service deployment, only compile images.
71
+ if skip_deployment
72
+ return deployment_result
73
+ end
74
+
69
75
  # First deploy initial services.
70
76
  # This feature is used to deploy some services, required for deployment of other services, e.g. env files
71
77
  # Note: Initial services are deployed without dependencies
data/lib/kuber_kit/cli.rb CHANGED
@@ -42,6 +42,7 @@ class KuberKit::CLI < Thor
42
42
  method_option :skip_dependencies, :type => :boolean, aliases: ["-D"]
43
43
  method_option :require_confirmation, :type => :boolean, aliases: ["-r"]
44
44
  method_option :skip_confirmation, :type => :boolean, aliases: ["-R"]
45
+ method_option :skip_deployment, :type => :boolean, aliases: ["-K"]
45
46
  def deploy
46
47
  setup(options)
47
48
 
@@ -57,6 +58,7 @@ class KuberKit::CLI < Thor
57
58
  skip_services: (options[:skip_services] || []).flatten.uniq,
58
59
  skip_compile: options[:skip_compile] || false,
59
60
  skip_dependencies: options[:skip_dependencies] || false,
61
+ skip_deployment: options[:skip_deployment] || false,
60
62
  require_confirmation: require_confirmation
61
63
  )
62
64
  end
@@ -3,13 +3,18 @@ class KuberKit::Core::ContextHelper::ContextVars
3
3
 
4
4
  BuildArgUndefined = Class.new(KuberKit::Error)
5
5
 
6
- def initialize(context_vars, parent_name = nil, parent = nil)
6
+ def initialize(context_vars, parent_name = nil)
7
7
  @context_vars = context_vars
8
8
  @parent_name = parent_name
9
- @parent = parent
10
9
  end
11
10
 
12
- def read(*variable_names)
11
+ def read(*variable_names, default: nil)
12
+ dig(*variable_names)
13
+ rescue BuildArgUndefined
14
+ return default
15
+ end
16
+
17
+ def dig(*variable_names)
13
18
  result = self
14
19
  variable_names.each do |var|
15
20
  result = result.get_variable_value(var)
@@ -18,7 +23,7 @@ class KuberKit::Core::ContextHelper::ContextVars
18
23
  end
19
24
 
20
25
  def variable_defined?(*variable_names)
21
- read(*variable_names)
26
+ dig(*variable_names)
22
27
  return true
23
28
  rescue BuildArgUndefined
24
29
  return false
@@ -29,7 +34,7 @@ class KuberKit::Core::ContextHelper::ContextVars
29
34
  raise ArgumentError.new("context args does not accept any arguments")
30
35
  end
31
36
 
32
- read(name)
37
+ dig(name)
33
38
  end
34
39
 
35
40
  def to_h
@@ -46,23 +51,16 @@ class KuberKit::Core::ContextHelper::ContextVars
46
51
  end
47
52
 
48
53
  if value.is_a?(Hash)
49
- return self.class.new(value, variable_name, self)
54
+ return self.class.new(value, format_arg(variable_name))
50
55
  end
51
56
 
52
57
  value
53
58
  end
54
59
 
55
60
  private
61
+
56
62
 
57
63
  def format_arg(name)
58
- string = [@parent_name, name].compact.join(".")
59
- parent = @parent
60
-
61
- while parent do
62
- string = [parent.parent_name, string].compact.join(".")
63
- parent = parent.parent
64
- end
65
-
66
- string
64
+ [@parent_name, name].compact.join(".")
67
65
  end
68
66
  end
@@ -1,3 +1,3 @@
1
1
  module KuberKit
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.4"
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: 1.1.2
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Khaziev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-16 00:00:00.000000000 Z
11
+ date: 2023-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contracts