eac_launcher 0.4.0 → 0.5.0
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/exe/eac_launcher_publish +1 -0
- data/lib/eac_launcher/context.rb +5 -1
- data/lib/eac_launcher/context/instance_manager.rb +26 -2
- data/lib/eac_launcher/git/publish_base.rb +1 -5
- data/lib/eac_launcher/instances/runner_helper.rb +2 -0
- data/lib/eac_launcher/publish/base.rb +20 -0
- data/lib/eac_launcher/publish/check_result.rb +4 -0
- data/lib/eac_launcher/stereotypes/ruby_gem/publish.rb +1 -5
- data/lib/eac_launcher/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c324b8f85e2f9e0c1bf361975a6819b452da017ea28d0f0f6a404d4a1317cb18
|
4
|
+
data.tar.gz: dba44e7346080c992d0685cb8f6f2073d5001c8b55977dc03d31ddf4c2c0eeca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c583eaa14ecbf7bf75bbe5620281e9d7055b9a8b070f7a5692c9a45b528c0229f4b72c3244588e9677bc50b22887d0a6911377618f882ce159b91269a59769e3
|
7
|
+
data.tar.gz: a15a502859f808a545c4036e891929d3c92170b23769a48f336aea75250ee6c2453178472cc1e395d351226a911f3518273846858f4c4a6073dcdd6d039d5d91
|
data/exe/eac_launcher_publish
CHANGED
data/lib/eac_launcher/context.rb
CHANGED
@@ -20,7 +20,7 @@ module EacLauncher
|
|
20
20
|
end
|
21
21
|
|
22
22
|
attr_reader :root, :settings, :cache_root
|
23
|
-
attr_accessor :publish_options, :recache
|
23
|
+
attr_accessor :publish_options, :recache, :instance_manager
|
24
24
|
|
25
25
|
def initialize(options = {})
|
26
26
|
@options = options.with_indifferent_access
|
@@ -40,6 +40,10 @@ module EacLauncher
|
|
40
40
|
@instance_manager.instances
|
41
41
|
end
|
42
42
|
|
43
|
+
def pending_instances
|
44
|
+
@instance_manager.pending_instances
|
45
|
+
end
|
46
|
+
|
43
47
|
private
|
44
48
|
|
45
49
|
def build_option(key)
|
@@ -7,6 +7,18 @@ module EacLauncher
|
|
7
7
|
@context = context
|
8
8
|
end
|
9
9
|
|
10
|
+
def publish_state_set(instance, stereotype_name, check_status)
|
11
|
+
data = cached_instances_file_content_uncached
|
12
|
+
data[instance.logical] ||= {}
|
13
|
+
data[instance.logical][:publish_state] ||= {}
|
14
|
+
data[instance.logical][:publish_state][stereotype_name] = check_status
|
15
|
+
write_cache_file(data)
|
16
|
+
end
|
17
|
+
|
18
|
+
def pending_instances
|
19
|
+
instances.select { |instance| pending_instance?(instance) }
|
20
|
+
end
|
21
|
+
|
10
22
|
private
|
11
23
|
|
12
24
|
def instances_uncached
|
@@ -31,15 +43,27 @@ module EacLauncher
|
|
31
43
|
end
|
32
44
|
|
33
45
|
def cache_instances(instances)
|
34
|
-
|
35
|
-
::File.write(cache_file_path, r.to_yaml)
|
46
|
+
write_cache_file(Hash[instances.map { |i| [i.logical, i.to_h] }])
|
36
47
|
instances
|
37
48
|
end
|
38
49
|
|
50
|
+
def write_cache_file(data)
|
51
|
+
::File.write(cache_file_path, data.to_yaml)
|
52
|
+
end
|
53
|
+
|
39
54
|
def cache_file_path
|
40
55
|
::File.join(@context.cache_root, 'instances.yml')
|
41
56
|
end
|
42
57
|
|
58
|
+
def pending_instance?(instance)
|
59
|
+
data = cached_instances_file_content
|
60
|
+
return false unless data[instance.logical]
|
61
|
+
return false unless data[instance.logical][:publish_state].is_a?(Hash)
|
62
|
+
data[instance.logical][:publish_state].any? do |_k, v|
|
63
|
+
::EacLauncher::Publish::CheckResult.pending_status?(v)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
43
67
|
class CachedInstances
|
44
68
|
def initialize(content)
|
45
69
|
@content = content
|
@@ -8,10 +8,6 @@ module EacLauncher
|
|
8
8
|
|
9
9
|
CHECKERS = %w[publish_remote_no_exist remote_equal remote_following local_following].freeze
|
10
10
|
|
11
|
-
def initialize(instance)
|
12
|
-
@instance = instance
|
13
|
-
end
|
14
|
-
|
15
11
|
protected
|
16
12
|
|
17
13
|
def internal_check
|
@@ -61,7 +57,7 @@ module EacLauncher
|
|
61
57
|
end
|
62
58
|
|
63
59
|
def sgit_uncached
|
64
|
-
::EacLauncher::Git::Base.new(
|
60
|
+
::EacLauncher::Git::Base.new(instance.warped)
|
65
61
|
end
|
66
62
|
|
67
63
|
def publish
|
@@ -1,6 +1,12 @@
|
|
1
1
|
module EacLauncher
|
2
2
|
module Publish
|
3
3
|
class Base
|
4
|
+
attr_reader :instance
|
5
|
+
|
6
|
+
def initialize(instance)
|
7
|
+
@instance = instance
|
8
|
+
end
|
9
|
+
|
4
10
|
def run
|
5
11
|
s = check
|
6
12
|
info("Check: #{s}")
|
@@ -9,6 +15,20 @@ module EacLauncher
|
|
9
15
|
end
|
10
16
|
|
11
17
|
def check
|
18
|
+
s = check_with_rescue
|
19
|
+
::EacLauncher::Context.current.instance_manager.publish_state_set(
|
20
|
+
instance, stereotype.stereotype_name, s.status
|
21
|
+
)
|
22
|
+
s
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def stereotype
|
28
|
+
self.class.name.deconstantize.constantize
|
29
|
+
end
|
30
|
+
|
31
|
+
def check_with_rescue
|
12
32
|
internal_check
|
13
33
|
rescue ::EacLauncher::Instances::Error => ex
|
14
34
|
::EacLauncher::Publish::CheckResult.blocked("Error: #{ex}")
|
@@ -5,10 +5,6 @@ module EacLauncher
|
|
5
5
|
include ::Eac::SimpleCache
|
6
6
|
include ::EacRubyUtils::Console::Speaker
|
7
7
|
|
8
|
-
def initialize(instance)
|
9
|
-
@instance = instance
|
10
|
-
end
|
11
|
-
|
12
8
|
protected
|
13
9
|
|
14
10
|
def internal_check
|
@@ -55,7 +51,7 @@ module EacLauncher
|
|
55
51
|
end
|
56
52
|
|
57
53
|
def source_uncached
|
58
|
-
|
54
|
+
instance.warped
|
59
55
|
end
|
60
56
|
|
61
57
|
def gem_spec_uncached
|
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.
|
4
|
+
version: 0.5.0
|
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: 2019-04-
|
11
|
+
date: 2019-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|