deployhq 1.3.3 → 1.3.4

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: c43e11b1ef4849e98c9be942b9658b8b8dedeb12
4
- data.tar.gz: 3a78e73a8cf1231665a35aa1e82334ad0ae79cbe
3
+ metadata.gz: 723ab3de0e1e230b74f7d7693ab21a364e10f740
4
+ data.tar.gz: 7e1278b6f5a88dba69ee5bbb5bd77d07a76ae22a
5
5
  SHA512:
6
- metadata.gz: 30287957a5bcab37ca9179e06457f423916656e81f6739578bab4a7ab1b8b3eb308be29b23f238ea19534af00240416488775c6ad860cfe786ff46605c68c2d4
7
- data.tar.gz: 14101ba5008e92fb8ade0628aabcb0957cc51e6890f8eab364cb01ddc8fb06865d66ee0685d6318d68da1a609da95f4cea0f137fd722a75352ac6a67ba145ace
6
+ metadata.gz: 44315effe285ba11ec9a8cf03676c58b1fc7a7ff380237933d155aee509e37bc602dada22df25fc3ff00d388ba13a15bbe546b8d763a1e2db3ca93de0fd676d1
7
+ data.tar.gz: 75271d3366c67bbf22a1699caf048d7b5e32f84a0698507344213867d3ecbd28cada60dbdf1656f6e7a8d7d454ef921e38175599e66b2a3ed82083c76f52912d
data/bin/deployhq CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+ libdir = File.expand_path('../../lib', __FILE__)
3
+ $LOAD_PATH.unshift(libdir)
2
4
 
3
5
  require 'deploy/cli'
4
6
 
data/lib/deploy/cli.rb CHANGED
@@ -102,10 +102,11 @@ module Deploy
102
102
  @longest_server_name = @server_names.values.map(&:length).max
103
103
 
104
104
  last_tap = nil
105
+ last_tap_lines = 0
105
106
  current_status = 'pending'
106
107
  previous_status = ''
107
- print "Waiting for deployment capacity..."
108
- while ['running', 'pending'].include?(current_status) do
108
+ STDOUT.print "Waiting for deployment capacity..."
109
+ while ['running', 'pending'].include?(current_status)
109
110
  sleep 1
110
111
 
111
112
  poll = @deployment.status_poll(:since => last_tap, :status => current_status)
@@ -114,15 +115,29 @@ module Deploy
114
115
  current_status = poll.status if poll.status
115
116
 
116
117
  if current_status == 'pending'
117
- print "."
118
+ STDOUT.print "."
118
119
  elsif current_status == 'running' && previous_status == 'pending'
119
- puts "\n"
120
+ STDOUT.puts "\n"
120
121
  end
121
122
 
122
123
  if current_status != 'pending'
123
124
  poll.taps.each do |tap|
124
- puts format_tap(tap)
125
+ # Delete most recent tap and redraw it if it's been updated
126
+ if tap.id.to_i == last_tap
127
+ if tap.updated
128
+ # Restore the cursor to the start of the last entry so we can overwrite
129
+ STDOUT.print "\e[#{last_tap_lines}A\r"
130
+ else
131
+ next
132
+ end
133
+ end
134
+
135
+ tap_output = format_tap(tap)
136
+ last_tap_lines = tap_output.count("\n")
125
137
  last_tap = tap.id.to_i
138
+
139
+ STDOUT.print tap_output
140
+ STDOUT.flush
126
141
  end
127
142
  end
128
143
 
@@ -138,11 +153,10 @@ module Deploy
138
153
  @longest_server_name = @server_names.values.map(&:length).max
139
154
 
140
155
  @deployment.taps.reverse.each do |tap|
141
- puts format_tap(tap)
156
+ STDOUT.puts format_tap(tap)
142
157
  end
143
158
  end
144
159
 
145
-
146
160
  ## Data formatters
147
161
 
148
162
  def format_tap(tap)
@@ -160,6 +174,15 @@ module Deploy
160
174
  String.new.tap do |s|
161
175
  s << "#{server_name} ".color(text_colour, :bold)
162
176
  s << tap.message.color(text_colour).gsub(/\<[^\>]*\>/, '')
177
+ if tap.backend_message && tap.tap_type == 'command'
178
+ tap.backend_message.each_line('<br />') do |backend_line|
179
+ s << "\n"
180
+ s << " " * server_name.length
181
+ s << " "
182
+ s << backend_line.color(text_colour).gsub(/\<[^\>]*\>/, '')
183
+ end
184
+ end
185
+ s << "\n"
163
186
  end
164
187
  end
165
188
 
@@ -1,3 +1,3 @@
1
1
  module Deploy
2
- VERSION = "1.3.3"
2
+ VERSION = "1.3.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deployhq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Wentworth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-11 00:00:00.000000000 Z
11
+ date: 2017-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.2.2
83
+ rubygems_version: 2.5.1
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: API and CLI client for the DeployHQ