capistrano_multiconfig_parallel 0.1.3 → 0.1.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e6f19bd4a7bf784e65f3bc34d3e49bb9e09cbe0
|
4
|
+
data.tar.gz: 69ce6bff1ffa9bb244ee9c12e6a035850c458be5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 500a0d5722c22bc3d00abfedd395050a7ce693fd9eec858cb4fc5d4f6ef82c62ce782b5cfb15aa6426fabf284f54dc4f0d3f1baee62b3ee00909ce74cfe41fbf
|
7
|
+
data.tar.gz: 7be10e250b4ed0e1c3990e4071816203022b0b7b20d34a8f60a1a1d475ec469b8ffd6a782b976e2e47fa193a80944c6276ea1f4e668c54a17225555875e202a5
|
@@ -105,12 +105,18 @@ module CapistranoMulticonfigParallel
|
|
105
105
|
@job_manager.condition.signal(results2) if results2.size == @jobs.size
|
106
106
|
end
|
107
107
|
|
108
|
+
def need_confirmations?
|
109
|
+
CapistranoMulticonfigParallel.configuration.task_confirmation_active.to_s.downcase == 'true'
|
110
|
+
end
|
111
|
+
|
108
112
|
def wait_task_confirmations
|
109
|
-
return unless
|
113
|
+
return unless need_confirmations?
|
110
114
|
CapistranoMulticonfigParallel.configuration.task_confirmations.each_with_index do |task, index|
|
111
115
|
results = []
|
112
116
|
@jobs.pmap do |job_id, _job|
|
113
|
-
|
117
|
+
current_job = @job_to_condition[job_id][:first_condition][index]
|
118
|
+
result = current_job.respond_to?(:wait) ? current_job.wait : current_job
|
119
|
+
results << result
|
114
120
|
end
|
115
121
|
if results.size == @jobs.size
|
116
122
|
confirm_task_approval(results, task)
|
@@ -120,17 +126,19 @@ module CapistranoMulticonfigParallel
|
|
120
126
|
|
121
127
|
def confirm_task_approval(results, task)
|
122
128
|
return unless results.present?
|
123
|
-
|
124
|
-
|
125
|
-
|
129
|
+
if results.detect {|x| !x.is_a?(Proc)}
|
130
|
+
set :apps_symlink_confirmation, CapistranoMulticonfigParallel.ask_confirm("Do you want to continue the deployment and execute #{task}?", 'Y/N')
|
131
|
+
until fetch(:apps_symlink_confirmation).present?
|
132
|
+
sleep(0.1) # keep current thread alive
|
133
|
+
end
|
126
134
|
end
|
127
135
|
return if fetch(:apps_symlink_confirmation).blank? || fetch(:apps_symlink_confirmation).downcase != 'y'
|
128
136
|
@jobs.pmap do |job_id, job|
|
129
137
|
worker = get_worker_for_job(job_id)
|
130
138
|
worker.publish_rake_event('approved' => 'yes',
|
131
|
-
|
132
|
-
|
133
|
-
|
139
|
+
'action' => 'invoke',
|
140
|
+
'job_id' => job['id'],
|
141
|
+
'task' => task
|
134
142
|
)
|
135
143
|
end
|
136
144
|
end
|
@@ -182,7 +182,7 @@ module CapistranoMulticonfigParallel
|
|
182
182
|
end
|
183
183
|
|
184
184
|
def need_confirmation_for_tasks?
|
185
|
-
executes_deploy? &&
|
185
|
+
executes_deploy? == true && @manager.need_confirmations?
|
186
186
|
end
|
187
187
|
|
188
188
|
def executes_deploy?
|