dapp 0.28.10 → 0.28.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 435bfad980694c0766403ee37dc76a22df40f9d1
4
- data.tar.gz: 547eb74b7dfcd6da66ac0198ee88c4481238f7d3
3
+ metadata.gz: d0130f71c694d70d32d1f329980b26847245ffb4
4
+ data.tar.gz: 9484cf39d55e453047b4b7ecb2580e639e7ebdb7
5
5
  SHA512:
6
- metadata.gz: 80568b12b3424f0d2565d0c0f3314ebca37b19d941af313ee5debbd5a871e55084effc0cee35fcd379867329f30a2b0714569e4ae8a19a832bcc95bfd2bcc05c
7
- data.tar.gz: 1003e256b226c28f2742e92b8847cbf0181fca828530f7f36b342f3294896d7e054b846c4f121a878e1c2775374c88df76f0386754f704ae825a68fd45afd52d
6
+ metadata.gz: 77ee063a4d28ae842b23bf14263d8dafbbe13115bee7ee50c7698f4139628939275ec5b7450cd8b8f4940e08320e0747c4728f8f8a123f8ca979074d0242442f
7
+ data.tar.gz: 8331131d6dd438a3bde9e32e435e9595e7719e84a84bbaecf2735fc2488ac5c9ee6fa32b934bf4029115bc6a1b9ef1e6485b12941fca320855cdc4c9bb6bc103
@@ -100,6 +100,8 @@ module Dapp
100
100
  return {} if from.nil?
101
101
  [:entrypoint, :cmd].each_with_object({}) do |option, options|
102
102
  options[option] = from.config_option(option.to_s.capitalize) || []
103
+ end.tap do |options|
104
+ options[:workdir] = Array(from.config_option('WorkingDir') || '/')
103
105
  end
104
106
  end
105
107
 
@@ -121,6 +123,7 @@ module Dapp
121
123
 
122
124
  def service_options
123
125
  {
126
+ workdir: '/',
124
127
  entrypoint: dapp.bash_bin,
125
128
  name: container_name,
126
129
  user: '0:0',
@@ -27,44 +27,9 @@ module Dapp
27
27
  end
28
28
 
29
29
  def kube_lint
30
- kube_check_helm_chart!
31
30
  kube_check_helm_chart_yaml!
32
-
33
- repo = option_repo
34
-
35
- docker_tag = option_tags.first
36
-
37
31
  with_kube_tmp_lint_chart_dir do
38
- kube_copy_chart
39
- kube_generate_helm_chart_tpl
40
- kube_helm_decode_secrets
41
-
42
- all_values = {}
43
- [kube_chart_path('values.yaml').expand_path, *kube_values_paths, *kube_tmp_chart_secret_values_paths].each do |values_path|
44
- all_values = all_values.in_depth_merge(yaml_load_file(values_path)) if File.file?(values_path)
45
- end
46
-
47
- options[:helm_set_options].each do |opt_spec|
48
- name, _, value = opt_spec.partition("=")
49
- keys = name.split(".")
50
-
51
- values = all_values
52
- keys.each_with_index do |key, ind|
53
- if ind == keys.size - 1
54
- values[key] = YAML.load(value)
55
- else
56
- values[key] ||= {}
57
- values = values[key]
58
- end
59
- end
60
- end
61
-
62
- service_values = Helm::Values.service_values_hash(self, repo, kube_namespace, docker_tag, fake: true)
63
- all_values = all_values.in_depth_merge service_values
64
-
65
- kube_chart_path_for_helm.join("values.yaml").write YAML.dump(all_values)
66
-
67
- shellout! "helm lint --strict #{kube_chart_path_for_helm}"
32
+ helm_release(&:lint!)
68
33
  end
69
34
  end
70
35
 
@@ -59,7 +59,7 @@ module Dapp
59
59
  "--name #{name}",
60
60
  *helm_additional_values_options,
61
61
  *helm_set_options,
62
- *helm_common_options,
62
+ *helm_install_options,
63
63
  ].join(" "))
64
64
 
65
65
  return cmd
@@ -70,7 +70,7 @@ module Dapp
70
70
  "helm upgrade #{name} #{chart_path}",
71
71
  *helm_additional_values_options,
72
72
  *helm_set_options,
73
- *helm_common_options
73
+ *helm_install_options
74
74
  ].join(" "))
75
75
 
76
76
  return cmd
@@ -99,6 +99,18 @@ module Dapp
99
99
  end
100
100
  end
101
101
 
102
+ def lint!
103
+ dapp.shellout! [
104
+ 'helm',
105
+ 'lint',
106
+ '--strict',
107
+ *helm_additional_values_options,
108
+ *helm_set_options(fake: true),
109
+ *helm_common_options,
110
+ chart_path
111
+ ].compact.join(' ')
112
+ end
113
+
102
114
  protected
103
115
 
104
116
  def evaluation_output
@@ -137,23 +149,32 @@ module Dapp
137
149
  @dimg_registry ||= dapp.dimg_registry(repo)
138
150
  end
139
151
 
140
- def helm_set_options(without_registry: false)
152
+ def helm_set_options(without_registry: false, fake: false)
141
153
  [].tap do |options|
142
154
  options.concat set.map {|opt| "--set #{opt}"}
143
155
 
144
- service_values = Helm::Values.service_values(dapp, repo, namespace, docker_tag, without_registry: self.without_registry || without_registry)
156
+ service_values = Helm::Values.service_values(dapp, repo, namespace, docker_tag,
157
+ without_registry: self.without_registry || without_registry,
158
+ fake: fake)
145
159
  options.concat service_values.to_set_options
146
160
  end
147
161
  end
148
162
 
163
+ def helm_install_options(dry_run: nil)
164
+ dry_run = dapp.dry_run? if dry_run.nil?
165
+
166
+ helm_common_options(dry_run: dry_run).tap do |options|
167
+ options << '--dry-run' if dry_run
168
+ options << "--timeout #{deploy_timeout}" if deploy_timeout
169
+ end
170
+ end
171
+
149
172
  def helm_common_options(dry_run: nil)
150
173
  dry_run = dapp.dry_run? if dry_run.nil?
151
174
 
152
175
  [].tap do |options|
153
176
  options << "--namespace #{namespace}" if namespace
154
- options << '--dry-run' if dry_run
155
- options << '--debug' if dry_run
156
- options << "--timeout #{deploy_timeout}" if deploy_timeout
177
+ options << '--debug' if dry_run
157
178
  end
158
179
  end
159
180
  end # Helm::Release
@@ -1,4 +1,4 @@
1
1
  module Dapp
2
- VERSION = "0.28.10"
3
- BUILD_CACHE_VERSION = 29
2
+ VERSION = "0.28.11"
3
+ BUILD_CACHE_VERSION = 30
4
4
  end
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.28.10
4
+ version: 0.28.11
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-05-30 00:00:00.000000000 Z
11
+ date: 2018-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout