kuber_kit 1.1.1 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/kuber_kit/actions/configuration_loader.rb +6 -2
- data/lib/kuber_kit/actions/kubectl_get.rb +3 -3
- data/lib/kuber_kit/actions/service_deployer.rb +7 -1
- data/lib/kuber_kit/cli.rb +7 -1
- data/lib/kuber_kit/configs.rb +2 -1
- data/lib/kuber_kit/core/artifacts/abstract_artifact.rb +4 -0
- data/lib/kuber_kit/core/artifacts/git.rb +4 -0
- data/lib/kuber_kit/core/artifacts/local.rb +4 -0
- data/lib/kuber_kit/core/context_helper/context_vars.rb +13 -15
- data/lib/kuber_kit/shell/commands/bash_commands.rb +6 -6
- data/lib/kuber_kit/shell/commands/docker_commands.rb +4 -4
- data/lib/kuber_kit/shell/commands/docker_compose_commands.rb +1 -1
- data/lib/kuber_kit/shell/commands/git_commands.rb +8 -8
- data/lib/kuber_kit/shell/commands/kubectl_commands.rb +2 -2
- data/lib/kuber_kit/shell/commands/rsync_commands.rb +1 -1
- data/lib/kuber_kit/shell/commands/system_commands.rb +1 -1
- data/lib/kuber_kit/shell/local_shell.rb +11 -7
- data/lib/kuber_kit/shell/ssh_session.rb +5 -1
- data/lib/kuber_kit/shell/ssh_shell.rb +2 -2
- data/lib/kuber_kit/shell_launcher/strategies/kubernetes.rb +9 -0
- data/lib/kuber_kit/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b70bdef220e67c9789122ab7eb7ee064dff475174ec1e497b0baf11566da6e1f
|
4
|
+
data.tar.gz: 004b9a6c4e8265f1f3f498b1b42fa35a0447567ef428abef4b571cce635c0cd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e60b51c8108814fc41f89b41a28732e59a8f5bddb938ee94d8cb765ccc5f2ea3de260aed0a52a212649389814884c40734c7f60fe77502e78e3814821c31790
|
7
|
+
data.tar.gz: 5f165249b8d91cd8bc148f9cc5f3a3a9a57402355c371b30f7f8511fcb6bf8d0650a7ba7a08c072dcba550837e52aced3a1d9cec4959be98c18d5b526678fb29
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6
|
1
|
+
2.7.6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
**1.2.1**
|
2
|
+
- Update shell commands so that STDERR stream won't be merged for commands using the command result.
|
3
|
+
- kit sh would also set current default configuration
|
4
|
+
- kit get supports "api" ui
|
5
|
+
- show sync description (git/local) for artifact sync
|
6
|
+
|
7
|
+
**1.2.0**
|
8
|
+
- Change minimal ruby version to 3
|
9
|
+
|
1
10
|
**1.1.1**
|
2
11
|
- Change minimal ruby version to 2.7
|
3
12
|
|
data/README.md
CHANGED
@@ -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)
|
@@ -109,9 +113,9 @@ class KuberKit::Actions::ConfigurationLoader
|
|
109
113
|
|
110
114
|
artifact_task_group = ui.create_task_group
|
111
115
|
not_local_artifacts.each do |artifact|
|
112
|
-
artifact_task_group.add("Updating #{artifact.name.to_s.yellow}") do |task|
|
116
|
+
artifact_task_group.add("Updating #{artifact.name.to_s.yellow} [#{artifact.sync_description.cyan}]") do |task|
|
113
117
|
artifact_updater.update(local_shell, artifact)
|
114
|
-
task.update_title("
|
118
|
+
task.update_title("Updating #{artifact.name.to_s.green} [#{artifact.sync_description.cyan}]")
|
115
119
|
end
|
116
120
|
end
|
117
121
|
artifact_task_group.wait
|
@@ -6,7 +6,7 @@ class KuberKit::Actions::KubectlGet
|
|
6
6
|
"ui"
|
7
7
|
]
|
8
8
|
|
9
|
-
Contract Maybe[String], Hash =>
|
9
|
+
Contract Maybe[String], Hash => Array
|
10
10
|
def call(resource_name, options)
|
11
11
|
kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
|
12
12
|
deployer_namespace = KuberKit.current_configuration.deployer_namespace
|
@@ -23,10 +23,10 @@ class KuberKit::Actions::KubectlGet
|
|
23
23
|
|
24
24
|
ui.print_info("Pods", resources.join("\n"))
|
25
25
|
|
26
|
-
|
26
|
+
resources
|
27
27
|
rescue KuberKit::Error => e
|
28
28
|
ui.print_error("Error", e.message)
|
29
29
|
|
30
|
-
|
30
|
+
[]
|
31
31
|
end
|
32
32
|
end
|
@@ -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
|
@@ -177,7 +179,11 @@ class KuberKit::CLI < Thor
|
|
177
179
|
setup(options)
|
178
180
|
|
179
181
|
if KuberKit::Container['actions.configuration_loader'].call(options.merge(load_inventory: false))
|
180
|
-
KuberKit::Container['actions.kubectl_get'].call(pod_name, options)
|
182
|
+
pods = KuberKit::Container['actions.kubectl_get'].call(pod_name, options)
|
183
|
+
|
184
|
+
print_result("Fetched list of pods", result: {
|
185
|
+
pods: pods
|
186
|
+
})
|
181
187
|
end
|
182
188
|
end
|
183
189
|
|
data/lib/kuber_kit/configs.rb
CHANGED
@@ -5,7 +5,7 @@ class KuberKit::Configs
|
|
5
5
|
:image_dockerfile_name, :image_build_context_dir, :image_tag, :docker_ignore_list, :image_compile_dir, :remote_image_compile_dir,
|
6
6
|
:kuber_kit_dirname, :kuber_kit_min_version, :images_dirname, :services_dirname, :infra_dirname, :configurations_dirname,
|
7
7
|
:artifact_clone_dir, :service_config_dir, :deployer_strategy, :compile_simultaneous_limit, :deploy_simultaneous_limit,
|
8
|
-
:additional_images_paths, :deprecation_warnings_disabled, :log_file_path, :env_file_compile_dir, :shell_launcher_strategy
|
8
|
+
:additional_images_paths, :deprecation_warnings_disabled, :log_file_path, :env_file_compile_dir, :shell_launcher_strategy, :shell_launcher_sets_configration
|
9
9
|
]
|
10
10
|
DOCKER_IGNORE_LIST = [
|
11
11
|
'Dockerfile',
|
@@ -59,6 +59,7 @@ class KuberKit::Configs
|
|
59
59
|
set :deprecation_warnings_disabled, false
|
60
60
|
set :log_file_path, File.join(absolute_kuber_kit_path, "deploy.log")
|
61
61
|
set :env_file_compile_dir, File.join(absolute_kuber_kit_path, "env_files")
|
62
|
+
set :shell_launcher_sets_configration, true
|
62
63
|
end
|
63
64
|
|
64
65
|
def items
|
@@ -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
|
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
|
-
|
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
|
-
|
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
|
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
|
-
|
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,27 +1,27 @@
|
|
1
1
|
require 'time'
|
2
2
|
class KuberKit::Shell::Commands::BashCommands
|
3
3
|
def rm(shell, path)
|
4
|
-
shell.exec!(%Q{rm "#{path}"})
|
4
|
+
shell.exec!(%Q{rm "#{path}"}, merge_stderr: true)
|
5
5
|
end
|
6
6
|
|
7
7
|
def rm_rf(shell, path)
|
8
|
-
shell.exec!(%Q{rm -rf "#{path}"})
|
8
|
+
shell.exec!(%Q{rm -rf "#{path}"}, merge_stderr: true)
|
9
9
|
end
|
10
10
|
|
11
11
|
def cp(shell, source_path, dest_path)
|
12
|
-
shell.exec!(%Q{cp "#{source_path}" "#{dest_path}"})
|
12
|
+
shell.exec!(%Q{cp "#{source_path}" "#{dest_path}"}, merge_stderr: true)
|
13
13
|
end
|
14
14
|
|
15
15
|
def cp_r(shell, source_path, dest_path)
|
16
|
-
shell.exec!(%Q{cp -r "#{source_path}" "#{dest_path}"})
|
16
|
+
shell.exec!(%Q{cp -r "#{source_path}" "#{dest_path}"}, merge_stderr: true)
|
17
17
|
end
|
18
18
|
|
19
19
|
def mkdir(shell, path)
|
20
|
-
shell.exec!(%Q{mkdir "#{path}"})
|
20
|
+
shell.exec!(%Q{mkdir "#{path}"}, merge_stderr: true)
|
21
21
|
end
|
22
22
|
|
23
23
|
def mkdir_p(shell, path)
|
24
|
-
shell.exec!(%Q{mkdir -p "#{path}"})
|
24
|
+
shell.exec!(%Q{mkdir -p "#{path}"}, merge_stderr: true)
|
25
25
|
end
|
26
26
|
|
27
27
|
def ctime(shell, path)
|
@@ -3,15 +3,15 @@ class KuberKit::Shell::Commands::DockerCommands
|
|
3
3
|
default_args = ["--rm=true"]
|
4
4
|
args_list = (default_args + args).join(" ")
|
5
5
|
|
6
|
-
shell.exec!(%Q{docker image build #{build_dir} #{args_list}})
|
6
|
+
shell.exec!(%Q{docker image build #{build_dir} #{args_list}}, merge_stderr: true)
|
7
7
|
end
|
8
8
|
|
9
9
|
def tag(shell, image_name, tag_name)
|
10
|
-
shell.exec!(%Q{docker tag #{image_name} #{tag_name}})
|
10
|
+
shell.exec!(%Q{docker tag #{image_name} #{tag_name}}, merge_stderr: true)
|
11
11
|
end
|
12
12
|
|
13
13
|
def push(shell, tag_name)
|
14
|
-
shell.exec!(%Q{docker push #{tag_name}})
|
14
|
+
shell.exec!(%Q{docker push #{tag_name}}, merge_stderr: true)
|
15
15
|
end
|
16
16
|
|
17
17
|
def run(shell, image_name, args: nil, command: nil, detached: false, interactive: false)
|
@@ -25,7 +25,7 @@ class KuberKit::Shell::Commands::DockerCommands
|
|
25
25
|
if interactive
|
26
26
|
shell.interactive!(command_parts.join(" "))
|
27
27
|
else
|
28
|
-
shell.exec!(command_parts.join(" "))
|
28
|
+
shell.exec!(command_parts.join(" "), merge_stderr: true)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -1,36 +1,36 @@
|
|
1
1
|
class KuberKit::Shell::Commands::GitCommands
|
2
2
|
def get_remote_url(shell, git_repo_path, remote_name: "origin")
|
3
|
-
shell.exec!
|
3
|
+
shell.exec!([
|
4
4
|
"cd #{git_repo_path}",
|
5
5
|
"git config --get remote.#{remote_name}.url",
|
6
|
-
].join(" && ")
|
6
|
+
].join(" && "), merge_stderr: true)
|
7
7
|
rescue KuberKit::Shell::AbstractShell::ShellError
|
8
8
|
return nil
|
9
9
|
end
|
10
10
|
|
11
11
|
def get_version_hash(shell, git_repo_path)
|
12
|
-
shell.exec!
|
12
|
+
shell.exec!([
|
13
13
|
"cd #{git_repo_path}",
|
14
14
|
"git rev-parse --short HEAD",
|
15
|
-
].join(" && ")
|
15
|
+
].join(" && "), merge_stderr: true)
|
16
16
|
end
|
17
17
|
|
18
18
|
def download_repo(shell, remote_url:, path:, branch:)
|
19
|
-
shell.exec!
|
19
|
+
shell.exec!([
|
20
20
|
"rm -rf #{path}",
|
21
21
|
"mkdir -p #{path}",
|
22
22
|
"git clone -b #{branch} --depth 1 #{remote_url} #{path}",
|
23
|
-
].join(" && ")
|
23
|
+
].join(" && "), merge_stderr: true)
|
24
24
|
end
|
25
25
|
|
26
26
|
def force_pull_repo(shell, path:, branch:)
|
27
|
-
shell.exec!
|
27
|
+
shell.exec!([
|
28
28
|
"cd #{path}",
|
29
29
|
"git add .",
|
30
30
|
"git reset HEAD --hard",
|
31
31
|
"git checkout #{branch}",
|
32
32
|
"git reset --hard '@{u}'",
|
33
33
|
"git pull --force",
|
34
|
-
].join(" && ")
|
34
|
+
].join(" && "), merge_stderr: true)
|
35
35
|
end
|
36
36
|
end
|
@@ -10,8 +10,8 @@ class KuberKit::Shell::Commands::KubectlCommands
|
|
10
10
|
kubeconfig_path: Maybe[Or[
|
11
11
|
String, KuberKit::Core::ArtifactPath
|
12
12
|
]],
|
13
|
-
namespace:
|
14
|
-
interactive:
|
13
|
+
namespace: Maybe[Or[Symbol, String]],
|
14
|
+
interactive: Optional[Bool],
|
15
15
|
] => Any
|
16
16
|
def kubectl_run(shell, command_list, kubeconfig_path: nil, namespace: nil, interactive: false)
|
17
17
|
command_parts = []
|
@@ -2,7 +2,7 @@ class KuberKit::Shell::Commands::SystemCommands
|
|
2
2
|
def kill_process(shell, pid)
|
3
3
|
# we need to use kill command directly sometimes,
|
4
4
|
# because Process.kill doesn't kill processes created by system() call
|
5
|
-
shell.exec!("kill -9 #{pid}")
|
5
|
+
shell.exec!("kill -9 #{pid}", merge_stderr: true)
|
6
6
|
true
|
7
7
|
rescue
|
8
8
|
false
|
@@ -9,7 +9,9 @@ class KuberKit::Shell::LocalShell < KuberKit::Shell::AbstractShell
|
|
9
9
|
"ui",
|
10
10
|
]
|
11
11
|
|
12
|
-
|
12
|
+
# @merge_stderr: Merge STDERR to the resulting stream. Could be helpful, if we don't want it printed to STDERR.
|
13
|
+
# Should be false, if we want to read & use the result of the command.
|
14
|
+
def exec!(command, log_command: true, merge_stderr: false)
|
13
15
|
command_number = command_counter.get_number.to_s.rjust(2, "0")
|
14
16
|
|
15
17
|
if log_command
|
@@ -17,7 +19,9 @@ class KuberKit::Shell::LocalShell < KuberKit::Shell::AbstractShell
|
|
17
19
|
end
|
18
20
|
|
19
21
|
result = nil
|
20
|
-
|
22
|
+
|
23
|
+
options = merge_stderr ? {err: [:child, :out]} : {}
|
24
|
+
IO.popen(wrap_command_with_pid(command), **options) do |io|
|
21
25
|
result = io.read.chomp.strip
|
22
26
|
end
|
23
27
|
|
@@ -88,21 +92,21 @@ class KuberKit::Shell::LocalShell < KuberKit::Shell::AbstractShell
|
|
88
92
|
end
|
89
93
|
|
90
94
|
def delete(file_path)
|
91
|
-
exec!("rm #{file_path}")
|
95
|
+
exec!("rm #{file_path}", merge_stderr: true)
|
92
96
|
end
|
93
97
|
|
94
98
|
def file_exists?(file_path)
|
95
|
-
exec!("test -f #{file_path} && echo 'true' || echo 'false'", log_command: false) == 'true'
|
99
|
+
exec!("test -f #{file_path} && echo 'true' || echo 'false'", log_command: false, merge_stderr: true) == 'true'
|
96
100
|
end
|
97
101
|
|
98
102
|
def dir_exists?(dir_path)
|
99
|
-
exec!("test -d #{dir_path} && echo 'true' || echo 'false'", log_command: false) == 'true'
|
103
|
+
exec!("test -d #{dir_path} && echo 'true' || echo 'false'", log_command: false, merge_stderr: true) == 'true'
|
100
104
|
end
|
101
105
|
|
102
106
|
def recursive_list_files(path, name: nil)
|
103
107
|
command = %Q{find -L #{path} -type f}
|
104
108
|
command += " -name '#{name}'" if name
|
105
|
-
exec!(command).split(/[\r\n]+/)
|
109
|
+
exec!(command, merge_stderr: true).split(/[\r\n]+/)
|
106
110
|
rescue => e
|
107
111
|
if e.message.include?("No such file or directory")
|
108
112
|
raise DirNotFoundError.new("Dir not found: #{path}")
|
@@ -113,7 +117,7 @@ class KuberKit::Shell::LocalShell < KuberKit::Shell::AbstractShell
|
|
113
117
|
|
114
118
|
def list_dirs(path)
|
115
119
|
command = %Q{find -L #{path} -maxdepth 0 -type d}
|
116
|
-
exec!(command).split(/[\r\n]+/)
|
120
|
+
exec!(command, merge_stderr: true).split(/[\r\n]+/)
|
117
121
|
rescue => e
|
118
122
|
if e.message.include?("No such file or directory")
|
119
123
|
raise DirNotFoundError.new("Dir not found: #{path}")
|
@@ -22,7 +22,7 @@ class KuberKit::Shell::SshSession
|
|
22
22
|
@session = nil
|
23
23
|
end
|
24
24
|
|
25
|
-
def exec!(command)
|
25
|
+
def exec!(command, merge_stderr: false)
|
26
26
|
stdout_data = ''
|
27
27
|
stderr_data = ''
|
28
28
|
exit_code = nil
|
@@ -38,6 +38,10 @@ class KuberKit::Shell::SshSession
|
|
38
38
|
|
39
39
|
channel.on_extended_data do |ch,type,data|
|
40
40
|
stderr_data += data
|
41
|
+
|
42
|
+
if merge_stderr
|
43
|
+
stdout_data += data
|
44
|
+
end
|
41
45
|
end
|
42
46
|
|
43
47
|
channel.on_request('exit-status') do |ch,data|
|
@@ -20,14 +20,14 @@ class KuberKit::Shell::SshShell < KuberKit::Shell::LocalShell
|
|
20
20
|
@ssh_session.disconnect if @ssh_session
|
21
21
|
end
|
22
22
|
|
23
|
-
def exec!(command, log_command: true)
|
23
|
+
def exec!(command, log_command: true, merge_stderr: false)
|
24
24
|
command_number = command_counter.get_number.to_s.rjust(2, "0")
|
25
25
|
|
26
26
|
if log_command
|
27
27
|
ui.print_debug("SshShell", "#{ssh_session.host.green} > Execute: [#{command_number}]: #{command.to_s.cyan}")
|
28
28
|
end
|
29
29
|
|
30
|
-
result = ssh_session.exec!(wrap_command_with_pid(command))
|
30
|
+
result = ssh_session.exec!(wrap_command_with_pid(command), merge_stderr: merge_stderr)
|
31
31
|
|
32
32
|
if result && result != "" && log_command
|
33
33
|
ui.print_debug("SshShell", "#{ssh_session.host.green} > Finished [#{command_number}] with result: \n#{result.grey}")
|
@@ -17,6 +17,15 @@ class KuberKit::ShellLauncher::Strategies::Kubernetes < KuberKit::ShellLauncher:
|
|
17
17
|
kubectl_commands.set_namespace(shell, deployer_namespace, kubeconfig_path: kubeconfig_path)
|
18
18
|
end
|
19
19
|
|
20
|
+
env_vars = [
|
21
|
+
"KUBECONFIG=#{kubeconfig_path}",
|
22
|
+
"KUBER_KIT_SHELL_CONFIGURATION=#{KuberKit.current_configuration.name}"
|
23
|
+
]
|
24
|
+
|
25
|
+
if configs.shell_launcher_sets_configration
|
26
|
+
env_vars << "KUBER_KIT_CONFIGURATION=#{KuberKit.current_configuration.name}"
|
27
|
+
end
|
28
|
+
|
20
29
|
shell.replace!(env: ["KUBECONFIG=#{kubeconfig_path}", "KUBER_KIT_SHELL_CONFIGURATION=#{KuberKit.current_configuration.name}"])
|
21
30
|
end
|
22
31
|
end
|
data/lib/kuber_kit/version.rb
CHANGED
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.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iskander Khaziev
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: contracts
|
@@ -382,7 +382,7 @@ homepage: https://github.com/ArtStation/kuber_kit
|
|
382
382
|
licenses:
|
383
383
|
- MIT
|
384
384
|
metadata: {}
|
385
|
-
post_install_message:
|
385
|
+
post_install_message:
|
386
386
|
rdoc_options: []
|
387
387
|
require_paths:
|
388
388
|
- lib
|
@@ -397,8 +397,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
397
397
|
- !ruby/object:Gem::Version
|
398
398
|
version: '0'
|
399
399
|
requirements: []
|
400
|
-
rubygems_version: 3.1.
|
401
|
-
signing_key:
|
400
|
+
rubygems_version: 3.1.6
|
401
|
+
signing_key:
|
402
402
|
specification_version: 4
|
403
403
|
summary: Docker Containers Build & Deployment
|
404
404
|
test_files: []
|