dapp 0.35.38 → 0.35.39
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb323b17a1e387036a9f838500748d92721ef6521336570321218d4fff136391
|
4
|
+
data.tar.gz: 35ad68f1c7770cf03f593d7a79da490bba0e6ac1003174cdeb3d8b6bb1d6a4ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d959200c31dd51ebab6aa03645de1a344ce2d799e4a40fc72e8911ac35de0713f0cdbc581e93a74c5611f941e86d4b6ba1defdce66497798f0398c91685c5573
|
7
|
+
data.tar.gz: 1feec282c7edc4a9b45b7538a008ddad33b8c03749353f0b0ef5af9b33253c1921bb5fa1ce6e43ddc9ee2a9e3490e573dc402c26080c69324bdf5c7f3a51901e
|
@@ -31,6 +31,7 @@ module Dapp
|
|
31
31
|
repo: repo,
|
32
32
|
docker_tag: tag,
|
33
33
|
namespace: kube_namespace,
|
34
|
+
kube_context: custom_kube_context,
|
34
35
|
chart_path: kube_chart_path_for_helm,
|
35
36
|
set: self.options[:helm_set_options],
|
36
37
|
values: [*kube_values_paths, *kube_tmp_chart_secret_values_paths],
|
@@ -345,10 +346,12 @@ image: {{ tuple $name $context | include "_dimg2" }}
|
|
345
346
|
options[:context]
|
346
347
|
end
|
347
348
|
|
349
|
+
def custom_kube_context
|
350
|
+
ENV["KUBECONTEXT"] || context_option
|
351
|
+
end
|
352
|
+
|
348
353
|
def kube_context
|
349
|
-
|
350
|
-
context_option ||
|
351
|
-
kubernetes_config.current_context_name
|
354
|
+
custom_kube_context || kubernetes_config.current_context_name
|
352
355
|
end
|
353
356
|
|
354
357
|
def kube_namespace
|
@@ -90,7 +90,12 @@ module Dapp
|
|
90
90
|
|
91
91
|
def kube_run_deploy(release)
|
92
92
|
log_process("Deploy release #{release.name}") do
|
93
|
-
helm_status_res = shellout(
|
93
|
+
helm_status_res = shellout([
|
94
|
+
"helm",
|
95
|
+
("--kube-context #{custom_kube_context}" if custom_kube_context),
|
96
|
+
"status",
|
97
|
+
release.name,
|
98
|
+
].compact.join(" "))
|
94
99
|
|
95
100
|
release_status = nil
|
96
101
|
if helm_status_res.status.success?
|
@@ -111,7 +116,12 @@ module Dapp
|
|
111
116
|
|
112
117
|
if File.exists? kube_helm_auto_purge_trigger_file_path(release.name)
|
113
118
|
log_process("Purge helm release #{release.name}") do
|
114
|
-
shellout!(
|
119
|
+
shellout!([
|
120
|
+
"helm",
|
121
|
+
("--kube-context #{custom_kube_context}" if custom_kube_context),
|
122
|
+
"delete",
|
123
|
+
"--purge #{release.name}",
|
124
|
+
].compact.join(" "))
|
115
125
|
end
|
116
126
|
|
117
127
|
# Purge-trigger file remains to exist
|
@@ -179,7 +189,8 @@ module Dapp
|
|
179
189
|
"resourceName" => job.name,
|
180
190
|
"namespace" => release.namespace,
|
181
191
|
"timeout" => timeout,
|
182
|
-
"logsFromTime" => kube_deploy_start_time
|
192
|
+
"logsFromTime" => kube_deploy_start_time,
|
193
|
+
"kubeContext" => custom_kube_context,
|
183
194
|
},
|
184
195
|
tmp_dir: tmp_dir,
|
185
196
|
)
|
@@ -268,7 +279,8 @@ module Dapp
|
|
268
279
|
"resourceName" => deployment_manager.name,
|
269
280
|
"namespace" => release.namespace,
|
270
281
|
"timeout" => timeout,
|
271
|
-
"logsFromTime" => kube_deploy_start_time
|
282
|
+
"logsFromTime" => kube_deploy_start_time,
|
283
|
+
"kubeContext" => custom_kube_context,
|
272
284
|
)
|
273
285
|
|
274
286
|
if res["error"]
|
@@ -8,14 +8,24 @@ module Dapp
|
|
8
8
|
kube_check_helm!
|
9
9
|
kube_check_helm_release!
|
10
10
|
log_process("Delete release #{kube_release_name}") do
|
11
|
-
shellout!
|
11
|
+
shellout!([
|
12
|
+
"helm",
|
13
|
+
("--kube-context #{custom_kube_context}" if custom_kube_context),
|
14
|
+
"delete",
|
15
|
+
kube_release_name,
|
16
|
+
"--purge",
|
17
|
+
].compact.join(" "))
|
12
18
|
kubernetes.delete_namespace!(kube_namespace) if options[:with_namespace]
|
13
19
|
end
|
14
20
|
end
|
15
21
|
end
|
16
22
|
|
17
23
|
def kube_check_helm_release!
|
18
|
-
pr = shellout(
|
24
|
+
pr = shellout([
|
25
|
+
"helm",
|
26
|
+
("--kube-context #{custom_kube_context}" if custom_kube_context),
|
27
|
+
"list | grep #{kube_release_name}"
|
28
|
+
].compact.join(" "))
|
19
29
|
raise ::Dapp::Error::Command, code: :helm_release_not_exist, data: { name: kube_release_name } if pr.status == 1 || pr.stdout.empty?
|
20
30
|
end
|
21
31
|
end
|
@@ -14,10 +14,11 @@ module Dapp
|
|
14
14
|
attr_reader :values
|
15
15
|
attr_reader :deploy_timeout
|
16
16
|
attr_reader :without_registry
|
17
|
+
attr_reader :kube_context
|
17
18
|
|
18
19
|
def initialize(dapp,
|
19
20
|
name:, repo:, docker_tag:, namespace:, chart_path:,
|
20
|
-
set: [], values: [], deploy_timeout: nil, without_registry: nil)
|
21
|
+
set: [], values: [], deploy_timeout: nil, without_registry: nil, kube_context: nil)
|
21
22
|
@dapp = dapp
|
22
23
|
|
23
24
|
@name = name
|
@@ -29,6 +30,7 @@ module Dapp
|
|
29
30
|
@values = values
|
30
31
|
@deploy_timeout = deploy_timeout
|
31
32
|
@without_registry = (without_registry.nil? ? false : without_registry)
|
33
|
+
@kube_context = kube_context
|
32
34
|
end
|
33
35
|
|
34
36
|
def jobs
|
@@ -60,6 +62,7 @@ module Dapp
|
|
60
62
|
*helm_additional_values_options,
|
61
63
|
*helm_set_options,
|
62
64
|
*helm_install_options,
|
65
|
+
("--kube-context #{kube_context}" if kube_context),
|
63
66
|
].join(" "))
|
64
67
|
|
65
68
|
return cmd
|
@@ -70,7 +73,8 @@ module Dapp
|
|
70
73
|
"helm upgrade #{name} #{chart_path}",
|
71
74
|
*helm_additional_values_options,
|
72
75
|
*helm_set_options,
|
73
|
-
*helm_install_options
|
76
|
+
*helm_install_options,
|
77
|
+
("--kube-context #{kube_context}" if kube_context),
|
74
78
|
].join(" "))
|
75
79
|
|
76
80
|
return cmd
|
@@ -107,6 +111,7 @@ module Dapp
|
|
107
111
|
*helm_additional_values_options,
|
108
112
|
*helm_set_options(fake: true),
|
109
113
|
*helm_common_options,
|
114
|
+
("--kube-context #{kube_context}" if kube_context),
|
110
115
|
chart_path
|
111
116
|
].compact.join(' ')
|
112
117
|
end
|
@@ -123,6 +128,7 @@ module Dapp
|
|
123
128
|
helm_set_options(without_registry: true),
|
124
129
|
("--namespace #{namespace}" if namespace),
|
125
130
|
"--name #{name}",
|
131
|
+
("--kube-context #{kube_context}" if kube_context),
|
126
132
|
].compact.join(" ")
|
127
133
|
|
128
134
|
cmd.stdout
|
@@ -32,11 +32,11 @@ module Dapp
|
|
32
32
|
res["global"]["dapp"]["ci"] = ci_info
|
33
33
|
|
34
34
|
if fake
|
35
|
-
elsif ENV["CI_COMMIT_TAG"]
|
36
|
-
ci_info["tag"] = ci_info["ref"] =
|
35
|
+
elsif commit_tag = (ENV["CI_BUILD_TAG"] || ENV["CI_COMMIT_TAG"])
|
36
|
+
ci_info["tag"] = ci_info["ref"] = commit_tag
|
37
37
|
ci_info["is_tag"] = true
|
38
|
-
elsif ENV["CI_COMMIT_REF_NAME"]
|
39
|
-
ci_info["branch"] = ci_info["ref"] =
|
38
|
+
elsif commit_ref_name = (ENV["CI_BUILD_REF_NAME"] || ENV["CI_COMMIT_REF_NAME"])
|
39
|
+
ci_info["branch"] = ci_info["ref"] = commit_ref_name
|
40
40
|
ci_info["is_branch"] = true
|
41
41
|
elsif dapp.git_own_repo_exist? and dapp.git_own_repo.head_branch_name != "HEAD"
|
42
42
|
ci_info["branch"] = ci_info["ref"] = dapp.git_own_repo.head_branch_name
|
data/lib/dapp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.35.
|
4
|
+
version: 0.35.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Stolyarov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|