kuber_kit 0.9.7 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/kuber_kit.gemspec +6 -0
- data/lib/kuber_kit/actions/kubectl_console.rb +4 -1
- data/lib/kuber_kit/actions/kubectl_describe.rb +6 -1
- data/lib/kuber_kit/kubernetes/resource_selector.rb +12 -17
- data/lib/kuber_kit/kubernetes/resources.rb +7 -0
- data/lib/kuber_kit/shell/commands/git_commands.rb +8 -0
- data/lib/kuber_kit/tools/build_dir_cleaner.rb +1 -0
- data/lib/kuber_kit/version.rb +1 -1
- data/lib/kuber_kit.rb +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b6ab3e069fffd079331ea898a239d3d75e05a971d808f2c5cd77b15e27ee7aa
|
4
|
+
data.tar.gz: b616c542fa526c9604f011f93d05ff747374836422261a794b8a305b80a425c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49a41b9e13384858588715d34b4cb4bd1d5625cb2c6a7301dc14004bd26fc87b536ba708ef3c49b4c5bb0bbf3987cdbab72bf67674731682573ab58a75926d7c
|
7
|
+
data.tar.gz: b3ace178e76c7a13cdf267572ac1040693dec090ee460e6600664893a546466c6bea00435dfa9e99ba3b3fb6cdd996a51cabb2af3c526238420753a51dcc6e93
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
**0.9.
|
1
|
+
**0.9.9**
|
2
|
+
- Fix updating artifact if it was force-pushed
|
3
|
+
- Improve resource selector, allow connecting to job via kit console
|
4
|
+
|
5
|
+
**0.9.0-0.9.8**
|
2
6
|
- Allow skipping confirmation during deployment
|
3
7
|
- Added `kit sh` command to create a new shell
|
4
8
|
- Use tmp dir as image builds parent dir for remote compilation
|
data/kuber_kit.gemspec
CHANGED
@@ -34,6 +34,12 @@ Gem::Specification.new do |spec|
|
|
34
34
|
else
|
35
35
|
spec.add_dependency "dry-auto_inject", "~> 0.7.0"
|
36
36
|
end
|
37
|
+
|
38
|
+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0')
|
39
|
+
spec.add_dependency "dry-core", "~> 0.8.1"
|
40
|
+
else
|
41
|
+
spec.add_dependency "dry-core", "~> 0.7.1"
|
42
|
+
end
|
37
43
|
|
38
44
|
spec.add_dependency "thor"
|
39
45
|
spec.add_dependency "cli-ui"
|
@@ -13,7 +13,10 @@ class KuberKit::Actions::KubectlConsole
|
|
13
13
|
deployer_namespace = KuberKit.current_configuration.deployer_namespace
|
14
14
|
|
15
15
|
if !pod_name
|
16
|
-
pod_name = resource_selector.call("attach"
|
16
|
+
pod_name = resource_selector.call("attach", additional_resources: [
|
17
|
+
KuberKit::Kubernetes::Resources::POD,
|
18
|
+
KuberKit::Kubernetes::Resources::JOB,
|
19
|
+
])
|
17
20
|
end
|
18
21
|
|
19
22
|
kubectl_commands.exec(
|
@@ -12,7 +12,12 @@ class KuberKit::Actions::KubectlDescribe
|
|
12
12
|
deployer_namespace = KuberKit.current_configuration.deployer_namespace
|
13
13
|
|
14
14
|
if !resource_name
|
15
|
-
resource_name = resource_selector.call("describe",
|
15
|
+
resource_name = resource_selector.call("describe", additional_resources: [
|
16
|
+
KuberKit::Kubernetes::Resources::INGRESS,
|
17
|
+
KuberKit::Kubernetes::Resources::POD,
|
18
|
+
KuberKit::Kubernetes::Resources::JOB,
|
19
|
+
KuberKit::Kubernetes::Resources::CRONJOB
|
20
|
+
])
|
16
21
|
end
|
17
22
|
|
18
23
|
args = nil
|
@@ -6,26 +6,21 @@ class KuberKit::Kubernetes::ResourceSelector
|
|
6
6
|
]
|
7
7
|
|
8
8
|
Contract String, KeywordArgs[
|
9
|
-
|
10
|
-
|
9
|
+
immediate_resource: Optional[String],
|
10
|
+
additional_resources: Optional[ArrayOf[String]]
|
11
11
|
] => Any
|
12
|
-
def call(action_name,
|
13
|
-
deployments = resources_fetcher.call(
|
14
|
-
options = deployments.map{|d| "
|
15
|
-
options
|
16
|
-
options << "pods" if include_pods
|
12
|
+
def call(action_name, immediate_resource: "deploy", additional_resources: [])
|
13
|
+
deployments = resources_fetcher.call(immediate_resource)
|
14
|
+
options = deployments.map{|d| "#{immediate_resource}/#{d}" }
|
15
|
+
options += additional_resources
|
17
16
|
option = ui.prompt("Please select resource to #{action_name}", options)
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
if option == "pods" && include_pods
|
26
|
-
ingresses = resources_fetcher.call("pods")
|
27
|
-
options = ingresses.map{|d| "pods/#{d}" }
|
28
|
-
return ui.prompt("Please select pod to #{action_name}", options)
|
18
|
+
additional_resources.each do |resource_name|
|
19
|
+
if option == resource_name && additional_resources.include?(resource_name)
|
20
|
+
ingresses = resources_fetcher.call(resource_name)
|
21
|
+
options = ingresses.map{|d| "#{resource_name}/#{d}" }
|
22
|
+
return ui.prompt("Please select #{resource_name} to #{action_name}", options)
|
23
|
+
end
|
29
24
|
end
|
30
25
|
|
31
26
|
option
|
@@ -8,6 +8,13 @@ class KuberKit::Shell::Commands::GitCommands
|
|
8
8
|
return nil
|
9
9
|
end
|
10
10
|
|
11
|
+
def get_version_hash(shell, git_repo_path)
|
12
|
+
shell.exec! [
|
13
|
+
"cd #{git_repo_path}",
|
14
|
+
"git rev-parse --short HEAD",
|
15
|
+
].join(" && ")
|
16
|
+
end
|
17
|
+
|
11
18
|
def download_repo(shell, remote_url:, path:, branch:)
|
12
19
|
shell.exec! [
|
13
20
|
"rm -rf #{path}",
|
@@ -22,6 +29,7 @@ class KuberKit::Shell::Commands::GitCommands
|
|
22
29
|
"git add .",
|
23
30
|
"git reset HEAD --hard",
|
24
31
|
"git checkout #{branch}",
|
32
|
+
"git reset --hard '@{u}'",
|
25
33
|
"git pull --force",
|
26
34
|
].join(" && ")
|
27
35
|
end
|
data/lib/kuber_kit/version.rb
CHANGED
data/lib/kuber_kit.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: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iskander Khaziev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: contracts
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.8.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: dry-core
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.7.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.7.1
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: thor
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -318,6 +332,7 @@ files:
|
|
318
332
|
- lib/kuber_kit/image_compiler/image_dependency_resolver.rb
|
319
333
|
- lib/kuber_kit/image_compiler/version_tag_builder.rb
|
320
334
|
- lib/kuber_kit/kubernetes/resource_selector.rb
|
335
|
+
- lib/kuber_kit/kubernetes/resources.rb
|
321
336
|
- lib/kuber_kit/kubernetes/resources_fetcher.rb
|
322
337
|
- lib/kuber_kit/preprocessing/file_preprocessor.rb
|
323
338
|
- lib/kuber_kit/preprocessing/text_preprocessor.rb
|