capistrano_multiconfig_parallel 0.21.7 → 0.21.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/capistrano_multiconfig_parallel/application.rb +1 -1
- data/lib/capistrano_multiconfig_parallel/celluloid/celluloid_manager.rb +1 -1
- data/lib/capistrano_multiconfig_parallel/celluloid/terminal_table.rb +1 -14
- data/lib/capistrano_multiconfig_parallel/classes/job.rb +12 -3
- data/lib/capistrano_multiconfig_parallel/version.rb +1 -1
- 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: 1e0b5a6c4d757da56822db1d3841df24d849005f
|
4
|
+
data.tar.gz: 47e706d3ca497fcce259094b026baeda873fa173
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 156d0a858b5cac59ae2e393ec367f010b47efff8d212826eee6e5c45ea1446ab780f9200a1e7a728b36b0a2d8df71885e1d49f801c8996dd0939982407e85f16
|
7
|
+
data.tar.gz: e10b68c1ac518825a070dd221d77ab8c80a02c2e74ec5ca42e09431d87bda94ef32864e2a805a88bad2b626ded2cd44ab99e92c0b1cad657c957b579d990a907
|
@@ -219,7 +219,7 @@ module CapistranoMulticonfigParallel
|
|
219
219
|
env_options = branch_name.present? ? { 'BRANCH' => branch_name }.merge(options['env_options']) : options['env_options']
|
220
220
|
job_env_options = custom_command? && env_options['ACTION'].present? ? env_options.except('ACTION') : env_options
|
221
221
|
|
222
|
-
job = CapistranoMulticonfigParallel::Job.new(options.merge(
|
222
|
+
job = CapistranoMulticonfigParallel::Job.new(Actor.current, options.merge(
|
223
223
|
action: custom_command? && env_options['ACTION'].present? ? env_options['ACTION'] : options['action'],
|
224
224
|
env_options: job_env_options
|
225
225
|
))
|
@@ -194,7 +194,7 @@ module CapistranoMulticonfigParallel
|
|
194
194
|
options.stringify_keys! if options.present?
|
195
195
|
env_opts = options['skip_env_options'].present? ? {} : @job_manager.get_app_additional_env_options(job.app, job.stage)
|
196
196
|
new_job_options = job.options.merge('env_options' => job.env_options.merge(env_opts))
|
197
|
-
new_job = CapistranoMulticonfigParallel::Job.new(new_job_options.merge(options.except(job.job_writer_attributes)))
|
197
|
+
new_job = CapistranoMulticonfigParallel::Job.new(@job_manager, new_job_options.merge(options.except(job.job_writer_attributes)))
|
198
198
|
new_job.setup_writer_attributes(options)
|
199
199
|
async.delegate(new_job) unless job.worker_died?
|
200
200
|
end
|
@@ -44,7 +44,7 @@ module CapistranoMulticonfigParallel
|
|
44
44
|
|
45
45
|
def setup_table_jobs(table, jobs)
|
46
46
|
jobs.each_with_index do |(_job_id, job), count|
|
47
|
-
|
47
|
+
table.add_row(job.terminal_row(count))
|
48
48
|
table.add_separator
|
49
49
|
end
|
50
50
|
end
|
@@ -60,19 +60,6 @@ module CapistranoMulticonfigParallel
|
|
60
60
|
@job_manager.condition.signal('completed') if @manager.all_workers_finished?
|
61
61
|
end
|
62
62
|
|
63
|
-
def worker_state(job)
|
64
|
-
default = job.status.to_s.upcase.red
|
65
|
-
return default unless @manager.alive?
|
66
|
-
worker = @manager.get_worker_for_job(job.id)
|
67
|
-
worker.alive? ? worker.worker_state : default
|
68
|
-
end
|
69
|
-
|
70
|
-
def add_job_to_table(table, job, index)
|
71
|
-
job_state = worker_state(job)
|
72
|
-
job_row = job.terminal_row(index, job_state)
|
73
|
-
table.add_row(job_row)
|
74
|
-
end
|
75
|
-
|
76
63
|
def terminal_clear
|
77
64
|
system('cls') || system('clear') || puts("\e[H\e[2J")
|
78
65
|
end
|
@@ -15,8 +15,10 @@ module CapistranoMulticonfigParallel
|
|
15
15
|
:setup_command_line_standard,
|
16
16
|
to: :command
|
17
17
|
|
18
|
-
def initialize(options)
|
18
|
+
def initialize(application, options)
|
19
19
|
@options = options
|
20
|
+
@application = application
|
21
|
+
@manager = @application.manager
|
20
22
|
end
|
21
23
|
|
22
24
|
def env_variable
|
@@ -27,17 +29,24 @@ module CapistranoMulticonfigParallel
|
|
27
29
|
@command ||= CapistranoMulticonfigParallel::JobCommand.new(self)
|
28
30
|
end
|
29
31
|
|
30
|
-
def terminal_row(index
|
32
|
+
def terminal_row(index)
|
31
33
|
[
|
32
34
|
{ value: (index + 1).to_s },
|
33
35
|
{ value: id.to_s },
|
34
36
|
{ value: job_stage },
|
35
37
|
{ value: capistrano_action },
|
36
38
|
{ value: setup_command_line_standard(filtered_keys: [CapistranoMulticonfigParallel::ENV_KEY_JOB_ID]).join("\n") },
|
37
|
-
{ value:
|
39
|
+
{ value: worker_state }
|
38
40
|
]
|
39
41
|
end
|
40
42
|
|
43
|
+
def worker_state
|
44
|
+
default = status.to_s.upcase.red
|
45
|
+
return default unless @manager.alive?
|
46
|
+
worker = @manager.get_worker_for_job(id)
|
47
|
+
worker.alive? ? worker.worker_state : default
|
48
|
+
end
|
49
|
+
|
41
50
|
def job_writer_attributes
|
42
51
|
%w(status exit_status)
|
43
52
|
end
|