capistrano_multiconfig_parallel 2.7.1 → 2.8.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/lib/capistrano_multiconfig_parallel/all.rb +1 -3
- data/lib/capistrano_multiconfig_parallel/celluloid/bundler_worker.rb +3 -2
- data/lib/capistrano_multiconfig_parallel/celluloid/celluloid_worker.rb +10 -2
- data/lib/capistrano_multiconfig_parallel/classes/child_process_status.rb +1 -1
- data/lib/capistrano_multiconfig_parallel/classes/job.rb +10 -5
- data/lib/capistrano_multiconfig_parallel/helpers/application_helper.rb +15 -2
- data/lib/capistrano_multiconfig_parallel/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0c51f13a444f7f6dec0885bfb772ed94b30c75a
|
4
|
+
data.tar.gz: c48a808ce7a4ab1b1080a9c684a6f15de0fa5533
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58237118c9429a9388020f6153c7bc462394fb5f2b59cf0a521e984f2b98bf9087db6f998583f05b724b50c500a38d1d6a833ed74d734e104b89fff79716c16c
|
7
|
+
data.tar.gz: c8196672583a80018516959201e05259f269106c7135154d00f4160ef4a5345248409f7f5282197ed5ba435dba183e0552b84d6fc6bb74a08a0e03041d17a97c
|
@@ -34,7 +34,7 @@ require 'forwardable'
|
|
34
34
|
require 'English'
|
35
35
|
|
36
36
|
# fix error with not files that can not be found
|
37
|
-
|
37
|
+
Gem.find_files('composable_state_machine/**/*.rb').each { |path| require path }
|
38
38
|
|
39
39
|
require_relative './helpers/base_actor_helper'
|
40
40
|
|
@@ -45,5 +45,3 @@ end
|
|
45
45
|
%w(version base application).each do |filename|
|
46
46
|
Gem.find_files("capistrano_multiconfig_parallel/#{filename}.rb").each { |path| require path }
|
47
47
|
end
|
48
|
-
|
49
|
-
Terminal::Table::Style.defaults = {:width => 140}
|
@@ -33,7 +33,7 @@ module CapistranoMulticonfigParallel
|
|
33
33
|
else
|
34
34
|
@progress_bar ||= PowerBar.new
|
35
35
|
@progress_bar.define_singleton_method :terminal_width do
|
36
|
-
|
36
|
+
CapistranoMulticonfigParallel::ApplicationHelper::DEFAULT_TEXT_LENGTH
|
37
37
|
end
|
38
38
|
@progress_bar.settings.tty.finite.template.main = \
|
39
39
|
"${<msg>} ${<bar> } ${<percent>%}" # + "${<rate>/s} ${<elapsed>}${ ETA: <eta>}"
|
@@ -43,7 +43,8 @@ module CapistranoMulticonfigParallel
|
|
43
43
|
@progress_bar.settings.tty.finite.template.close = "\e[?25h\e[0mFINISHED \n" # clean up after us
|
44
44
|
@progress_bar.settings.tty.finite.output = Proc.new{ |data|
|
45
45
|
if data.present? && data.include?("Error") || data.include?("Installing")
|
46
|
-
@job.
|
46
|
+
@job.bundler_check_status_colour = data.include?("Error") ? :red : :green
|
47
|
+
@job.bundler_check_status = data.to_s
|
47
48
|
send_msg(CapistranoMulticonfigParallel::BundlerTerminalTable.topic, type: 'event', data: data.to_s.uncolorize )
|
48
49
|
end
|
49
50
|
}
|
@@ -51,10 +51,18 @@ module CapistranoMulticonfigParallel
|
|
51
51
|
|
52
52
|
def worker_state
|
53
53
|
if job.status.to_s.downcase != 'dead' && Actor.current.alive?
|
54
|
-
@machine.state.to_s
|
54
|
+
@machine.state.to_s
|
55
55
|
else
|
56
56
|
job.status = 'dead'
|
57
|
-
job.status.upcase
|
57
|
+
job.status.upcase
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def state_colour
|
62
|
+
if job.status.to_s.downcase != 'dead' && Actor.current.alive?
|
63
|
+
return :green
|
64
|
+
else
|
65
|
+
return :red
|
58
66
|
end
|
59
67
|
end
|
60
68
|
|
@@ -25,7 +25,7 @@ module CapistranoMulticonfigParallel
|
|
25
25
|
|
26
26
|
def on_read_stdout(data)
|
27
27
|
@show_bundler = false if data.to_s.include?("The Gemfile's dependencies are satisfied") || data.to_s.include?("Bundle complete")
|
28
|
-
@actor.async.update_machine_state(truncate(data,
|
28
|
+
@actor.async.update_machine_state(truncate(data, CapistranoMulticonfigParallel::ApplicationHelper::DEFAULT_TEXT_LENGTH), :bundler => true) if @show_bundler == true && data.strip.present? && data.strip != '.'
|
29
29
|
io_callback('stdout', data)
|
30
30
|
end
|
31
31
|
|
@@ -51,7 +51,7 @@ module CapistranoMulticonfigParallel
|
|
51
51
|
{ value: wrap_string(job_stage_for_terminal) },
|
52
52
|
{ value: wrap_string(capistrano_action) },
|
53
53
|
{ value: terminal_env_variables.map { |str| wrap_string(str) }.join("\n") },
|
54
|
-
{ value:
|
54
|
+
{ value: wrap_coloured_string(*worker_state) }
|
55
55
|
]
|
56
56
|
end
|
57
57
|
end
|
@@ -61,7 +61,7 @@ module CapistranoMulticonfigParallel
|
|
61
61
|
{ value: wrap_string(id.to_s) },
|
62
62
|
{ value: wrap_string(File.basename(job.job_path)) },
|
63
63
|
{ value: wrap_string("bundle check || bundle install") },
|
64
|
-
{ value:
|
64
|
+
{ value: wrap_coloured_string(bundler_check_status.to_s, color: bundler_check_status_colour) }
|
65
65
|
]
|
66
66
|
end
|
67
67
|
|
@@ -71,7 +71,7 @@ module CapistranoMulticonfigParallel
|
|
71
71
|
{ value: wrap_string(job_stage_for_terminal) },
|
72
72
|
{ value: wrap_string("Setting up gems..") },
|
73
73
|
{ value: terminal_env_variables.map { |str| wrap_string(str) }.join("\n") },
|
74
|
-
{ value:
|
74
|
+
{ value: wrap_coloured_string(status.to_s, color: :green) }
|
75
75
|
]
|
76
76
|
end
|
77
77
|
|
@@ -89,8 +89,12 @@ module CapistranoMulticonfigParallel
|
|
89
89
|
|
90
90
|
def worker_state
|
91
91
|
worker_obj = worker
|
92
|
-
default = status.to_s.upcase
|
93
|
-
worker_died?
|
92
|
+
default = status.to_s.upcase
|
93
|
+
if worker_died?
|
94
|
+
[default, color: :red]
|
95
|
+
else
|
96
|
+
[worker_obj.worker_state, color: worker.state_colour]
|
97
|
+
end
|
94
98
|
end
|
95
99
|
|
96
100
|
def id
|
@@ -108,6 +112,7 @@ module CapistranoMulticonfigParallel
|
|
108
112
|
{ name: 'exit_status', default: nil },
|
109
113
|
{ name: 'bundler_status', default: nil },
|
110
114
|
{ name: 'bundler_check_status', default: nil },
|
115
|
+
{ name: 'bundler_check_status_colour', default: :green },
|
111
116
|
{ name: 'new_jobs_dispatched', default: [] },
|
112
117
|
{ name: 'will_dispatch_new_job', default: nil },
|
113
118
|
].each do |hash|
|
@@ -7,6 +7,8 @@ require_relative './capistrano_helper'
|
|
7
7
|
module CapistranoMulticonfigParallel
|
8
8
|
# class that holds the options that are configurable for this gem
|
9
9
|
module ApplicationHelper
|
10
|
+
DEFAULT_TEXT_LENGTH = 22
|
11
|
+
|
10
12
|
include CapistranoMulticonfigParallel::InternalHelper
|
11
13
|
include CapistranoMulticonfigParallel::CoreHelper
|
12
14
|
include CapistranoMulticonfigParallel::ParseHelper
|
@@ -78,9 +80,20 @@ module CapistranoMulticonfigParallel
|
|
78
80
|
[args.select(&:present?), options]
|
79
81
|
end
|
80
82
|
|
81
|
-
def
|
83
|
+
def internal_wrap_string(string, options = {})
|
82
84
|
options.stringify_keys!
|
83
|
-
string.scan(/.{#{options.fetch('length',
|
85
|
+
string.scan(/.{#{options.fetch('length', CapistranoMulticonfigParallel::ApplicationHelper::DEFAULT_TEXT_LENGTH)}}|.+/).map(&:strip)
|
86
|
+
end
|
87
|
+
|
88
|
+
def wrap_string(string, options = {})
|
89
|
+
internal_wrap_string(string, options).join(options.fetch('character', $INPUT_RECORD_SEPARATOR))
|
90
|
+
end
|
91
|
+
|
92
|
+
def wrap_coloured_string(string, options = {})
|
93
|
+
new_array = internal_wrap_string(string, options).collect do |str|
|
94
|
+
str.colorize(options["color"].to_s.to_sym)
|
95
|
+
end
|
96
|
+
new_array.join(options.fetch('character', $INPUT_RECORD_SEPARATOR))
|
84
97
|
end
|
85
98
|
|
86
99
|
def percent_of(index, total)
|