eac_launcher 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eac_launcher.rb +1 -0
- data/lib/eac_launcher/git/base.rb +8 -3
- data/lib/eac_launcher/git/base/subrepo.rb +9 -0
- data/lib/eac_launcher/git/base/underlying.rb +5 -0
- data/lib/eac_launcher/git/error.rb +9 -0
- data/lib/eac_launcher/git/mirror_update.rb +1 -3
- data/lib/eac_launcher/publish/base.rb +2 -0
- data/lib/eac_launcher/stereotypes/git_subrepo.rb +1 -1
- data/lib/eac_launcher/stereotypes/git_subrepo/warp.rb +8 -11
- data/lib/eac_launcher/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa09c1db1d7f7920eda7d026847a546e94b65bc2
|
4
|
+
data.tar.gz: 96b777bdb3d914eaa887068900ec1b7d70f7a753
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac3ba7b71c29973e5f709dec912b6cb87809312b4ea7c2424e51ed64efeb378ab8f287b6b7999d7846cd73f616e0e8896bf1fb6450f03cabe54ffc9f99df1bd8
|
7
|
+
data.tar.gz: 1dec30133f1e3544012e458bf4c89aa0cf28ed53e9ab4adeed854f89fb3452741158d2e5aff4f31546571ccfd153254a8ff53bb5698518c71586a55eb2b1cae8
|
data/lib/eac_launcher.rb
CHANGED
@@ -19,6 +19,7 @@ module EacLauncher
|
|
19
19
|
require 'eac_launcher/stereotype'
|
20
20
|
require 'eac_launcher/context/settings'
|
21
21
|
require 'eac_launcher/git/base'
|
22
|
+
require 'eac_launcher/git/error'
|
22
23
|
require 'eac_launcher/git/mirror_update'
|
23
24
|
require 'eac_launcher/git/publish_base'
|
24
25
|
require 'eac_launcher/git/warp_base'
|
@@ -14,11 +14,12 @@ module EacLauncher
|
|
14
14
|
File.exist?(subpath('.git'))
|
15
15
|
end
|
16
16
|
|
17
|
-
def rev_parse(ref)
|
17
|
+
def rev_parse(ref, required = false)
|
18
18
|
r = execute!('rev-parse', ref, exit_outputs: { 128 => nil, 32_768 => nil })
|
19
19
|
r.strip! if r.is_a?(String)
|
20
|
-
r
|
21
|
-
|
20
|
+
return r if r.present?
|
21
|
+
return nil unless required
|
22
|
+
raise "Reference \"#{ref}\" not found"
|
22
23
|
end
|
23
24
|
|
24
25
|
def remote_hashs(remote_name)
|
@@ -95,6 +96,10 @@ module EacLauncher
|
|
95
96
|
execute!('reset', '--hard', ref)
|
96
97
|
end
|
97
98
|
|
99
|
+
def raise(message)
|
100
|
+
::Kernel.raise EacLauncher::Git::Error.new(self, message)
|
101
|
+
end
|
102
|
+
|
98
103
|
private
|
99
104
|
|
100
105
|
def merge_base_pair(c1, c2)
|
@@ -4,6 +4,15 @@ module EacLauncher
|
|
4
4
|
module Subrepo
|
5
5
|
def subrepo_status(subrepo_path)
|
6
6
|
s = execute!('subrepo', 'status', subrepo_path.gsub(%r{\A/}, ''))
|
7
|
+
raise s.strip.to_s if s.include?('is not a subrepo')
|
8
|
+
r = subrepo_status_parse_output(s)
|
9
|
+
raise "Empty subrepo status for |#{s}|\n" unless r.any?
|
10
|
+
r
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def subrepo_status_parse_output(s)
|
7
16
|
r = {}.with_indifferent_access
|
8
17
|
s.each_line do |l|
|
9
18
|
m = /\A([^\:]+)\:(.*)\z/.match(l.strip)
|
@@ -24,9 +24,7 @@ module EacLauncher
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def reset_source_rev
|
27
|
-
|
28
|
-
raise "Hash not found for ref. \"#{@source_rev}\" in \"#{@source_git}\"" unless h
|
29
|
-
@target_git.reset_hard(h)
|
27
|
+
@target_git.reset_hard(@source_git.rev_parse(@source_rev, true))
|
30
28
|
end
|
31
29
|
end
|
32
30
|
end
|
@@ -12,6 +12,8 @@ module EacLauncher
|
|
12
12
|
internal_check
|
13
13
|
rescue ::EacLauncher::Instances::Error => ex
|
14
14
|
::EacLauncher::Publish::CheckResult.blocked("Error: #{ex}")
|
15
|
+
rescue ::EacLauncher::Git::Error => ex
|
16
|
+
::EacLauncher::Publish::CheckResult.blocked("Git error: #{ex}")
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
@@ -10,8 +10,7 @@ module EacLauncher
|
|
10
10
|
@instance = instance
|
11
11
|
check_parent
|
12
12
|
init_aux
|
13
|
-
|
14
|
-
push
|
13
|
+
push_to_aux
|
15
14
|
reset
|
16
15
|
assert_target_remote
|
17
16
|
super(cache_git)
|
@@ -27,9 +26,10 @@ module EacLauncher
|
|
27
26
|
end
|
28
27
|
|
29
28
|
def subrepo_parent_hash
|
30
|
-
|
29
|
+
data = parent_cache_git.subrepo_status(instance.to_parent_path)
|
30
|
+
h = data['Pull Parent']
|
31
31
|
return h if h.present?
|
32
|
-
raise
|
32
|
+
raise EacLauncher::Instances::Error, "Subrepo parent hash is blank: #{data}"
|
33
33
|
end
|
34
34
|
|
35
35
|
def init_aux
|
@@ -56,13 +56,10 @@ module EacLauncher
|
|
56
56
|
::EacLauncher::Git::Base.new(instance.cache_path('git_repository'))
|
57
57
|
end
|
58
58
|
|
59
|
-
def
|
60
|
-
parent_cache_git.execute!('subrepo', '
|
61
|
-
parent_cache_git.
|
62
|
-
|
63
|
-
|
64
|
-
def push
|
65
|
-
parent_cache_git.execute!('subrepo', 'push', subrepo_subdir, '-r', aux_path, '-f')
|
59
|
+
def push_to_aux
|
60
|
+
parent_cache_git.execute!('subrepo', 'branch', subrepo_subdir, '-fF')
|
61
|
+
h = parent_cache_git.rev_parse("subrepo/#{subrepo_subdir}", true)
|
62
|
+
parent_cache_git.execute!('push', aux_path, "#{h}:refs/heads/master", '--force')
|
66
63
|
end
|
67
64
|
|
68
65
|
def subrepo_subdir
|
data/lib/eac_launcher/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_launcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -154,6 +154,7 @@ files:
|
|
154
154
|
- lib/eac_launcher/git/base.rb
|
155
155
|
- lib/eac_launcher/git/base/subrepo.rb
|
156
156
|
- lib/eac_launcher/git/base/underlying.rb
|
157
|
+
- lib/eac_launcher/git/error.rb
|
157
158
|
- lib/eac_launcher/git/mirror_update.rb
|
158
159
|
- lib/eac_launcher/git/publish_base.rb
|
159
160
|
- lib/eac_launcher/git/warp_base.rb
|