hu 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hu/deploy.rb +28 -25
  3. data/lib/hu/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7cc26af0d32047802199428e01f0ba865a44f4a
4
- data.tar.gz: abc0ac52217ac81fb9ee3c3bb15970df9675afa5
3
+ metadata.gz: 7d7665c684bb8184985f565feea06cdde525679d
4
+ data.tar.gz: aa59c31deb645d009d829340d3be6ec1e384652a
5
5
  SHA512:
6
- metadata.gz: 90ba3f3689b51068377b7c6fed9a5f88dff552499caaf7e29d2e4a41f56569de865d06bfe709bd8240aa6bb63bb19e2bf13858843567cdf684f47413b901beca
7
- data.tar.gz: 21801cab2013fce68791d172245f7d65e76f5862ea470da43602c32d30454ea1afb3bae3f5d8c63ffe3ea1d430d656c8391f7808b93430d4e0819299bed201b9
6
+ metadata.gz: d8169fbabe8ab3674bc0acf50085483ec3e2609f37feeb89e62875f883f916c2918fea98b471f038adfff00730067910bfddf8f08ba262d113d5e123e28d0c40
7
+ data.tar.gz: 905c34198530bd0c5bcd4c1d887b79e9cda797e1a9c38629466580da8fbccbf2eb860055508d3c63a29caf2e927af1b732bc512454c260a8e5bfd5e56d445766
@@ -422,32 +422,35 @@ EOM
422
422
  have = 0
423
423
  release_rev = `git rev-parse develop`[0..7]
424
424
  parser = Proc.new do |line, pid|
425
- source, line = line.chomp.split(' ', 2)[1].split(' ', 2)
426
- source = /\[(.*)\]:/.match(source)[1]
427
- prefix = "\e[0m"
428
- case phase
429
- when :init
430
- if line =~ /Deploy #{release_rev}/
431
- phase = :observe
432
- end
433
- when :observe
434
- if line =~ /State changed from starting to crashed/
435
- prefix = "\e[31;1m"
436
- elsif line =~ /State changed from starting to up/
437
- prefix = "\e[32;1m"
438
- have += 1
439
- end
440
-
441
- t = Time.now.to_i - promoted_at
442
- ts = sprintf("%02d:%02d", t / 60, t % 60)
443
- print "\e[30;1m[\e[0;33mT+#{ts} #{prefix}#{have}\e[0m/#{prefix}#{want}\e[30;1m] \e[0m"
444
- print "#{source}: " unless source == 'api'
445
- print prefix + line
446
- puts
447
-
448
- if have >= want
449
- Process.kill("TERM", pid)
425
+ begin
426
+ source, line = line.chomp.split(' ', 2)[1].split(' ', 2)
427
+ source = /\[(.*)\]:/.match(source)[1]
428
+ prefix = "\e[0m"
429
+ case phase
430
+ when :init
431
+ if line =~ /Deploy #{release_rev}/
432
+ phase = :observe
433
+ end
434
+ when :observe
435
+ if line =~ /State changed from starting to crashed/
436
+ prefix = "\e[31;1m"
437
+ elsif line =~ /State changed from starting to up/
438
+ prefix = "\e[32;1m"
439
+ have += 1
440
+ end
441
+
442
+ t = Time.now.to_i - promoted_at
443
+ ts = sprintf("%02d:%02d", t / 60, t % 60)
444
+ print "\e[30;1m[\e[0;33mT+#{ts} #{prefix}#{have}\e[0m/#{prefix}#{want}\e[30;1m] \e[0m"
445
+ print "#{source}: " unless source == 'api'
446
+ print prefix + line
447
+ puts
448
+
449
+ if have >= want
450
+ Process.kill("TERM", pid)
451
+ end
450
452
  end
453
+ rescue
451
454
  end
452
455
  end
453
456
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hu
3
- VERSION = '2.0.0'
3
+ VERSION = '2.0.1'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hu
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - moe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-16 00:00:00.000000000 Z
11
+ date: 2018-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler