hu 1.4.2 → 1.4.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 +4 -4
- data/lib/hu/deploy.rb +51 -1
- data/lib/hu/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab85216f272433e54ed07a51cbfcb16b3af59b65
|
4
|
+
data.tar.gz: 13d3ade3dfd5f3ce55b98d55630fa603f15157d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70526faca386e04a0207e6f80096c6a193f3ad38e5fd2ab911e70b8f138e3be6c311a1823f4318f354077bf60026b5f30b9267a8fa005f18cc47eeb5603f45b2
|
7
|
+
data.tar.gz: f3734f5b47903fc965efc705545032357c706e48b78215e3482c68adb013eca7c8acdd6d74ccb7cc5b1b08f275dac4a28de71d8ab0bf9344266da2cbc8688294
|
data/lib/hu/deploy.rb
CHANGED
@@ -29,6 +29,9 @@ module Hu
|
|
29
29
|
$stdout.sync
|
30
30
|
@@shutting_down = false
|
31
31
|
@@spinner = nil
|
32
|
+
@@home_branch = nil
|
33
|
+
|
34
|
+
MINIMUM_GIT_VERSION = Versionomy.parse('2.9.0')
|
32
35
|
|
33
36
|
text 'Interactive deployment.'
|
34
37
|
desc 'Interactive deployment'
|
@@ -52,6 +55,7 @@ module Hu
|
|
52
55
|
end
|
53
56
|
Hu::Tm.flush!
|
54
57
|
shutdown
|
58
|
+
return_to_home_branch
|
55
59
|
print "\e[0m\e[?25h"
|
56
60
|
end
|
57
61
|
|
@@ -103,6 +107,7 @@ module Hu
|
|
103
107
|
end
|
104
108
|
|
105
109
|
push_url = heroku_git_remote
|
110
|
+
@@home_branch = current_branch_name
|
106
111
|
|
107
112
|
wc_update = Thread.new { update_working_copy }
|
108
113
|
|
@@ -145,6 +150,14 @@ module Hu
|
|
145
150
|
wc_update.join
|
146
151
|
unbusy
|
147
152
|
|
153
|
+
unless develop_can_be_merged_into_master?
|
154
|
+
puts
|
155
|
+
puts "ERROR: It seems like a merge of 'develop' into 'master' would fail.".color(:red)
|
156
|
+
puts " Aborting early to prevent a merge conflict.".color(:red)
|
157
|
+
puts
|
158
|
+
exit 1
|
159
|
+
end
|
160
|
+
|
148
161
|
highest_version = find_highest_version_tag
|
149
162
|
begin
|
150
163
|
highest_versionomy = Versionomy.parse(highest_version)
|
@@ -434,8 +447,13 @@ module Hu
|
|
434
447
|
table << r
|
435
448
|
end
|
436
449
|
|
450
|
+
git_version_warning = ''
|
451
|
+
if current_git_version < MINIMUM_GIT_VERSION
|
452
|
+
git_version_warning = " (your git is outdated. please upgrade to v#{MINIMUM_GIT_VERSION}!)".color(:black).bright
|
453
|
+
end
|
454
|
+
|
437
455
|
puts "\e[H\e[2J" if clear
|
438
|
-
puts " PIPELINE #{pipeline_name} ".inverse
|
456
|
+
puts " PIPELINE #{pipeline_name} ".inverse+git_version_warning
|
439
457
|
puts
|
440
458
|
|
441
459
|
puts table.render(:unicode, padding: [0, 1, 0, 1], multiline: true)
|
@@ -836,6 +854,38 @@ module Hu
|
|
836
854
|
Hu::Tm.t(:abort_merge, cmd: 'deploy')
|
837
855
|
end
|
838
856
|
|
857
|
+
def return_to_home_branch
|
858
|
+
return if @@home_branch.nil? or @@home_branch == current_branch_name
|
859
|
+
run_each <<-EOS.strip_heredoc
|
860
|
+
:quiet
|
861
|
+
:nospinner
|
862
|
+
:return
|
863
|
+
# Return to home branch
|
864
|
+
git checkout #{@@home_branch}
|
865
|
+
EOS
|
866
|
+
Hu::Tm.t(:return_home, cmd: 'deploy')
|
867
|
+
end
|
868
|
+
|
869
|
+
def develop_can_be_merged_into_master?
|
870
|
+
status = run_each <<-EOS.strip_heredoc
|
871
|
+
:quiet
|
872
|
+
:nospinner
|
873
|
+
:return
|
874
|
+
git checkout develop
|
875
|
+
git diff --exit-code --quiet develop..master || { git format-patch master --stdout >/tmp/hu.diff.tmp && git checkout master && git apply --check </tmp/hu.diff.tmp ; }
|
876
|
+
rm -f /tmp/hu.diff.tmp
|
877
|
+
EOS
|
878
|
+
status == 0
|
879
|
+
end
|
880
|
+
|
881
|
+
def current_branch_name
|
882
|
+
@git.head.name.sub(/^refs\/heads\//, '')
|
883
|
+
end
|
884
|
+
|
885
|
+
def current_git_version
|
886
|
+
Versionomy.parse(`git --version`.chomp.split(' ')[-1])
|
887
|
+
end
|
888
|
+
|
839
889
|
def create_changelog(env)
|
840
890
|
if File.executable? '.hu/hooks/changelog'
|
841
891
|
env.each { |k, v| ENV[k] = v }
|
data/lib/hu/version.rb
CHANGED
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: 1.4.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- moe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|