hu 2.0.13 → 2.0.14

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 +27 -2
  3. data/lib/hu/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58df20f500a0c96fa44b1e9ac0f74e480422bc0ff6f2edfdcfe0940a7f5a16e6
4
- data.tar.gz: e08634da86231c3169f26a2e2e50599ac5d65e2c5a20e9638f114d0089fd0381
3
+ metadata.gz: 115e72e64abe0e4b451b6dce7d3fd8570ad2185536b1f9b0795787a69ec6d7da
4
+ data.tar.gz: 4917db8d19bb3daba7ebad68f3194d33587eb2a848e03343733e1ddfe4f97cc6
5
5
  SHA512:
6
- metadata.gz: e476e1dcb160d2386fd935ef931891ae7774d8e306c65b8235327ea5d770de7553c849eeab28029ae59df54e254efa3f56baeadf200e2f82d38ffd78e4c7cc27
7
- data.tar.gz: 426c68fcfbb2d86b99586d93169384606ae6b8228d050fd9814fc7e791bb443aa2edf6c4803702269eb5f3d5ab3b1ee3aadcb3c2e7512cb0883d7521d9c2613f
6
+ metadata.gz: 1d681a1229a247463458f924830543d2ff0873cd4f51360a39376b9ab1c7c1a914980b713f202f2fb7046581d6222f2998b45679e0158cd689b66b5d17ee0686
7
+ data.tar.gz: f5cd00e298029c952890711c44a29770d6d310e112ea3b963298de15ea621b8b2be2efc26769f516fcd6627b7c2c3e8d90dfe224eabccdedb36205fb7f514a26
data/lib/hu/deploy.rb CHANGED
@@ -103,6 +103,8 @@ module Hu
103
103
  print "\e[0m\e[?25h"
104
104
  end
105
105
 
106
+ dp :discover
107
+
106
108
  begin
107
109
  @git = Rugged::Repository.discover('.')
108
110
  rescue Rugged::RepositoryError => e
@@ -126,6 +128,8 @@ module Hu
126
128
  exit 1
127
129
  end
128
130
 
131
+ dp 'detect git-flow'
132
+
129
133
  if @git.config['gitflow.branch.master'].nil?
130
134
  print TTY::Cursor.clear_line + TTY::Cursor.show
131
135
  puts
@@ -136,6 +140,8 @@ module Hu
136
140
  exit 1
137
141
  end
138
142
 
143
+ dp 'detect git-flow prefix'
144
+
139
145
  unless @git.config['gitflow.prefix.versiontag'].nil? ||
140
146
  @git.config['gitflow.prefix.versiontag'].empty?
141
147
  print TTY::Cursor.clear_line + TTY::Cursor.show
@@ -149,11 +155,15 @@ module Hu
149
155
  exit 1
150
156
  end
151
157
 
158
+ dp 'detect git-remote'
159
+
152
160
  push_url = heroku_git_remote
153
161
  @@home_branch = current_branch_name
154
162
 
163
+ dp 'update working copy'
155
164
  wc_update = Thread.new { update_working_copy }
156
165
 
166
+ dp 'fetch heroku apps'
157
167
  app = heroku_app_by_git(push_url)
158
168
 
159
169
  if app.nil?
@@ -167,8 +177,10 @@ module Hu
167
177
  exit 1
168
178
  end
169
179
 
180
+ dp 'fetch pipelines'
170
181
  pipeline_name, stag_app_id, prod_app_id = heroku_pipeline_details(app)
171
182
 
183
+ dp 'validate app id'
172
184
  if app['id'] != stag_app_id
173
185
  print TTY::Cursor.clear_line + TTY::Cursor.show
174
186
  puts
@@ -186,8 +198,11 @@ module Hu
186
198
 
187
199
  stag_app_name = app['name']
188
200
  busy 'synchronizing', :dots
201
+
202
+ dp 'fetch prod app'
189
203
  prod_app_name = h.app.info(prod_app_id)['name']
190
204
 
205
+ dp 'wait for update'
191
206
  wc_update.join
192
207
 
193
208
  unless develop_can_be_merged_into_master?
@@ -199,6 +214,7 @@ module Hu
199
214
  exit 1
200
215
  end
201
216
 
217
+ dp 'fetch version'
202
218
  highest_version = find_highest_version_tag
203
219
  begin
204
220
  highest_versionomy = Versionomy.parse(highest_version)
@@ -206,20 +222,26 @@ module Hu
206
222
  highest_versionomy = Versionomy.parse('v0.0.0')
207
223
  end
208
224
 
225
+ dp 'fetch tags'
209
226
  all_tags = Set.new(@git.references.to_a('refs/tags/*').collect { |o| o.name[10..-1] })
210
227
 
211
228
  tiny_bump = highest_versionomy.dup
212
229
  minor_bump = highest_versionomy.dup
213
230
  major_bump = highest_versionomy.dup
214
231
 
232
+ dp 'calc version A'
215
233
  loop do
216
234
  tiny_bump = tiny_bump.bump(:tiny)
217
235
  break unless all_tags.include? tiny_bump.to_s
218
236
  end
237
+
238
+ dp 'calc version B'
219
239
  loop do
220
240
  minor_bump = minor_bump.bump(:minor)
221
241
  break unless all_tags.include? minor_bump.to_s
222
242
  end
243
+
244
+ dp 'calc version C'
223
245
  loop do
224
246
  major_bump = major_bump.bump(:major)
225
247
  break unless all_tags.include? tiny_bump.to_s
@@ -238,6 +260,7 @@ module Hu
238
260
 
239
261
  clearscreen = true
240
262
  loop do
263
+ dp 'render'
241
264
  git_revisions = show_pipeline_status(pipeline_name, stag_app_name, prod_app_name, release_tag, clearscreen)
242
265
 
243
266
  if git_revisions[:develop] == `git rev-parse master`[0..5] && git_revisions[:develop] == git_revisions[prod_app_name] &&
@@ -1417,8 +1440,10 @@ EOF
1417
1440
  def dp(label, *args)
1418
1441
  return unless ENV['DEBUG']
1419
1442
  puts "--- DEBUG #{label} ---"
1420
- ap(*args)
1421
- puts "--- ^#{label}^ ---"
1443
+ if args.length > 0
1444
+ ap(*args)
1445
+ puts "--- ^#{label}^ ---"
1446
+ end
1422
1447
  end
1423
1448
 
1424
1449
  end # /Class Deploy
data/lib/hu/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hu
3
- VERSION = '2.0.13'
3
+ VERSION = '2.0.14'
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.13
4
+ version: 2.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - moe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-13 00:00:00.000000000 Z
11
+ date: 2019-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler