dapp 0.35.32 → 0.35.33

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
  SHA256:
3
- metadata.gz: ca5dde146d904440983b1123f2d4fa9e80b798f7d577fd947596300e94d34bcd
4
- data.tar.gz: 52d63d13d825f930a57ccf20db6de5a803b6995a6c1f409a8de686b21da81e97
3
+ metadata.gz: 48f519ec10c53a4fb3549ff563b47594824390b8404ac13a7ebba1aaea20cb83
4
+ data.tar.gz: 4b074bc979ee02916f9a647a05c7c7588d3d7d6592cf0cc4fc4819b2bfe22e47
5
5
  SHA512:
6
- metadata.gz: b7f1301e5e36d3a3febe19f9570afb4ff8334132a125e4e37d7bb19becd9dd71b51f9cfd63948066f35d47b70ca9b9715202a412db593b41649e605e4132a787
7
- data.tar.gz: 8148b67d0c84e20b959ce9dd2f779f348f9a09d5c56cb6876915d7b077b887781449c2d1a6a27321ad7b45339b003d55917fa0557fa2a32eeed69a7aaad7b39b
6
+ metadata.gz: e7a0d84c8f928a3038051bdf1720483620d19fd34df7421bfbe57ffefcc69da00bbbe5a728330baf03e2027780e0c28b6d7864fe6799d365d576863a58fb7181
7
+ data.tar.gz: 607025feab19d62bb4ab0eebaa84fe2681f1cdf8c332fb0eac52576f95499f6701068a882dbf16b09897a9b877d9e1aef93c0170a5b4dd319bf9c4de4f83d766
@@ -151,7 +151,6 @@ module Dapp
151
151
 
152
152
  def build_export_image!(image_name, scheme_name:)
153
153
  Image::Dimg.image_by_name(name: image_name, from: last_stage.image, dapp: dapp).tap do |export_image|
154
- export_image.untag! if export_image.built?
155
154
  export_image.add_service_change_label(:'dapp-tag-scheme' => scheme_name)
156
155
  export_image.add_service_change_label(:'dapp-dimg' => true)
157
156
  export_image.build!
@@ -109,7 +109,7 @@ module Dapp
109
109
  end
110
110
 
111
111
  def image_inspect
112
- ruby2go_command(:inspect, extended_image_option: false) if @image_inspect.nil?
112
+ ruby2go_command(:inspect, short_image_option: true) if @image_inspect.nil?
113
113
  @image_inspect
114
114
  end
115
115
 
@@ -174,19 +174,19 @@ module Dapp
174
174
  ruby2go_command(:untag)
175
175
  end
176
176
 
177
- def ruby2go_command(command, extended_image_option: true, options: {})
178
- command_options = ruby2go_command_options(command, extended_image_option: extended_image_option).in_depth_merge(options: options)
177
+ def ruby2go_command(command, short_image_option: false, options: {})
178
+ command_options = ruby2go_command_options(command, short_image_option: short_image_option).in_depth_merge(options: options)
179
179
  self.class.ruby2go_command(dapp, **command_options).tap do |data|
180
180
  set_ruby2go_state_hash(JSON.load(data['image']))
181
181
  end
182
182
  end
183
183
 
184
- def ruby2go_command_options(command, extended_image_option: true)
184
+ def ruby2go_command_options(command, short_image_option: false)
185
185
  image = begin
186
- if extended_image_option
187
- ruby2go_image_option
186
+ if short_image_option
187
+ ruby2go_short_image_option
188
188
  else
189
- JSON.dump({name: name})
189
+ ruby2go_image_option
190
190
  end
191
191
  end
192
192
 
@@ -200,6 +200,10 @@ module Dapp
200
200
  JSON.dump(get_ruby2go_state_hash)
201
201
  end
202
202
 
203
+ def ruby2go_short_image_option
204
+ JSON.dump(get_ruby2go_short_state_hash)
205
+ end
206
+
203
207
  def get_ruby2go_state_hash
204
208
  [
205
209
  :name,
@@ -225,6 +229,21 @@ module Dapp
225
229
  .to_h
226
230
  end
227
231
 
232
+ def get_ruby2go_short_state_hash
233
+ [
234
+ :name,
235
+ :bash_commands,
236
+ :service_bash_commands,
237
+ :options,
238
+ :change_options,
239
+ :service_change_options,
240
+ ].map do |name|
241
+ [name, send(name)]
242
+ end
243
+ .compact
244
+ .to_h
245
+ end
246
+
228
247
  def set_ruby2go_state_hash(state_hash)
229
248
  state_hash.each do |name, value|
230
249
  variable = "@#{name}".to_sym
@@ -8,6 +8,7 @@ module Dapp
8
8
 
9
9
  helm_release do |release|
10
10
  do_deploy = proc do
11
+ init_kube_deploy_start_time
11
12
  kube_run_deploy(release)
12
13
  end
13
14
 
@@ -19,6 +20,14 @@ module Dapp
19
20
  end
20
21
  end
21
22
 
23
+ def init_kube_deploy_start_time
24
+ @kube_deploy_start_time ||= Time.now.to_datetime.rfc3339
25
+ end
26
+
27
+ def kube_deploy_start_time
28
+ @kube_deploy_start_time
29
+ end
30
+
22
31
  def kube_flush_hooks_jobs(release)
23
32
  all_jobs_names = kube_all_jobs_names
24
33
 
@@ -159,17 +168,21 @@ module Dapp
159
168
  begin
160
169
  if ENV["KUBEDOG"] != "0"
161
170
  timeout = self.options[:timeout] || 300
162
- ruby2go_deploy_watcher(
171
+ res = ruby2go_deploy_watcher(
163
172
  "action" => "watch job",
164
173
  "resourceName" => job.name,
165
174
  "namespace" => release.namespace,
166
175
  "timeout" => timeout,
176
+ "logsFromTime" => kube_deploy_start_time
167
177
  )
178
+
179
+ if res["error"]
180
+ $stderr.puts(::Dapp::Dapp.paint_string(::Dapp::Helper::NetStatus.message(res["error"]), :warning))
181
+ end
168
182
  else
169
183
  Kubernetes::Manager::Job.new(self, job.name).watch_till_done!
170
184
  end
171
185
  rescue ::Exception => e
172
- sentry_exception(e, extra: {"job-spec" => job.spec})
173
186
  raise
174
187
  end
175
188
  end # watch_hooks.each
@@ -231,12 +244,17 @@ module Dapp
231
244
  deployment_managers.each {|deployment_manager|
232
245
  if deployment_manager.should_watch?
233
246
  if ENV["KUBEDOG"] == "1"
234
- ruby2go_deploy_watcher(
247
+ res = ruby2go_deploy_watcher(
235
248
  "action" => "watch deployment",
236
249
  "resourceName" => deployment_manager.name,
237
250
  "namespace" => release.namespace,
238
251
  "timeout" => timeout,
252
+ "logsFromTime" => kube_deploy_start_time
239
253
  )
254
+
255
+ if res["error"]
256
+ raise res["error"]
257
+ end
240
258
  else
241
259
  deployment_manager.watch_till_ready!
242
260
  end
@@ -1,4 +1,4 @@
1
1
  module Dapp
2
- VERSION = "0.35.32"
2
+ VERSION = "0.35.33"
3
3
  BUILD_CACHE_VERSION = 32
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.35.32
4
+ version: 0.35.33
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-12 00:00:00.000000000 Z
11
+ date: 2018-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout