mina-kubernetes 3.0.0 → 3.1.0
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/CHANGELOG.md +6 -0
- data/lib/mina/kubernetes/version.rb +1 -1
- data/lib/mina/kubernetes.rb +29 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4803de1f3f3decf1da5772d6ac1a9cbaa20810e722fc273e981071f57b219b7
|
4
|
+
data.tar.gz: 5b011e4604e76d94866888c5ab3676b740237d4cb5becf04e2a24f857c144960
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32284456c631a418eae7c04feca2d3ce5b059095012af00c90e5fd291002844f68aafdf919a6c435afb7c29ddc05c7f0c0f6527e71de0bfc945c43c13cf32bc6
|
7
|
+
data.tar.gz: c468d84b45f08bddad72937500f8e7054c87b5ee1d14dbc8b7d7ae903c96ae900330e6063b3f8250ba2bb1849bbe8debde463565d741db5bd31c155ad33b43b5
|
data/CHANGELOG.md
CHANGED
data/lib/mina/kubernetes.rb
CHANGED
@@ -8,19 +8,26 @@ set :execution_mode, :pretty
|
|
8
8
|
|
9
9
|
namespace :kubernetes do
|
10
10
|
set :proxy, nil
|
11
|
+
set :skip_image_ready_check, false
|
11
12
|
|
12
13
|
task :deploy, [:options] do |task, args|
|
13
14
|
desc "Set image tag to be latest commit of prompted branch (unless provided) then applies resources to cluster"
|
14
15
|
set_tag_from_branch_commit unless fetch(:image_tag)
|
15
|
-
wait_until_image_ready(fetch(:image_tag))
|
16
|
+
wait_until_image_ready(fetch(:image_tag)) unless fetch(:skip_image_ready_check)
|
16
17
|
create_namespace_on_cluster
|
17
18
|
apply_kubernetes_resources(args[:options])
|
18
19
|
end
|
19
20
|
|
21
|
+
task :global_deploy, [:options] do |task, args|
|
22
|
+
set_tag_from_branch_commit unless fetch(:image_tag)
|
23
|
+
wait_until_image_ready(fetch(:image_tag)) unless fetch(:skip_image_ready_check)
|
24
|
+
apply_global_kubernetes_resources(args[:options])
|
25
|
+
end
|
26
|
+
|
20
27
|
task :bash do
|
21
28
|
desc "Spins up temporary pod with image and opens remote interactive bash"
|
22
29
|
set_tag_from_branch_commit unless fetch(:image_tag)
|
23
|
-
wait_until_image_ready(fetch(:image_tag))
|
30
|
+
wait_until_image_ready(fetch(:image_tag)) unless fetch(:skip_image_ready_check)
|
24
31
|
run_command("bash")
|
25
32
|
end
|
26
33
|
|
@@ -118,7 +125,7 @@ def run_command(command, env_hash = {})
|
|
118
125
|
when :replace
|
119
126
|
system delete_command
|
120
127
|
run :local do
|
121
|
-
comment "
|
128
|
+
comment "Launching Pod #{color(pod_name, 36)} to run #{color(command, 36)}"
|
122
129
|
end
|
123
130
|
wait_for_image_and_run_command("#{pod_run_command} -- #{command}")
|
124
131
|
when :other
|
@@ -144,7 +151,25 @@ def apply_kubernetes_resources(options)
|
|
144
151
|
deploy_cmd += options[:deployment_options] if options&.[](:deployment_options)
|
145
152
|
|
146
153
|
ejson_secrets_path = "#{filepaths}/secrets.ejson"
|
147
|
-
deploy_cmd += " --filenames #{ejson_secrets_path}" if File.
|
154
|
+
deploy_cmd += " --filenames #{ejson_secrets_path}" if File.exist?(ejson_secrets_path)
|
155
|
+
|
156
|
+
command "#{render_cmd} | #{deploy_cmd}"
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
def apply_global_kubernetes_resources(options)
|
161
|
+
run :local do
|
162
|
+
comment "Applying all global Kubernetes resources..."
|
163
|
+
|
164
|
+
proxy_env = "HTTPS_PROXY=#{fetch(:proxy)}" if fetch(:proxy)
|
165
|
+
filepaths = options&.[](:filepaths) || "config/deploy/#{fetch(:stage)}"
|
166
|
+
|
167
|
+
render_cmd = "#{proxy_env} krane render --bindings=image_repo=#{fetch(:image_repo)},image_tag=#{fetch(:image_tag)},nzamespace=#{fetch(:namespace)} --current_sha #{fetch(:image_tag)} -f #{filepaths}"
|
168
|
+
deploy_cmd = "#{proxy_env} krane global-deploy #{fetch(:kubernetes_context)} --selector #{fetch(:global_deploy_selector_key)}=#{fetch(:global_deploy_selector_value)} --stdin "
|
169
|
+
deploy_cmd += options[:deployment_options] if options&.[](:deployment_options)
|
170
|
+
|
171
|
+
ejson_secrets_path = "#{filepaths}/secrets.ejson"
|
172
|
+
deploy_cmd += " --filenames #{ejson_secrets_path}" if File.exist?(ejson_secrets_path)
|
148
173
|
|
149
174
|
command "#{render_cmd} | #{deploy_cmd}"
|
150
175
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mina-kubernetes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antoine Sabourin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|