capistrano_multiconfig_parallel 0.11.2 → 0.11.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23b653b45d5d3f58d974343ae030e98ff377e5ef
4
- data.tar.gz: f750a49d6e43cbdb14b814ab720f99702b3b2e92
3
+ metadata.gz: 6e3ee4bdf3fef14756626f8c3aa37346af35061f
4
+ data.tar.gz: a7977209db28f942efd3cd5782b0f4b418bc3d3e
5
5
  SHA512:
6
- metadata.gz: 7911b3e0870cd261a9d68d67580d7c5810db76835457fb0e6efc95e8056675388e0d3c4a0f9b33e73feb9d223a11db18bf3323bcefba9a97104f13392c0e7558
7
- data.tar.gz: d906087062964a83e84f326a7a2f224243905185d6ce668a2e00f6ce70ec48613131bc9e57aafbf3eabbfd2f1569a36a6a94388209b6f8afd2f3d4b91deac0ed
6
+ metadata.gz: 29010db137366388494ad4cf1a877d16451bb72ce6d2ca3b7077029f36801c944254549c4ab7f9b6d64e873a9cc11339c9c30972e888b7bd99c887fb212db151
7
+ data.tar.gz: 3401ec88ed79515d49d5c8fa20b17790b5ac79fb5aceb8b732877332ce698da0007000eec67f3a3b4fe1d727d76dccf5df899ed0df9921094b2f1e12a4bbdc81
@@ -223,7 +223,7 @@ module CapistranoMulticonfigParallel
223
223
 
224
224
  def dispatch_new_job(job)
225
225
  original_env = job['env_options']
226
- env_opts = @job_manager.get_app_additional_env_options(job['app_name'], job['stage'])
226
+ env_opts = @job_manager.get_app_additional_env_options(job['app_name'], job['env'])
227
227
  job['env_options'] = original_env.merge(env_opts)
228
228
  async.delegate(job)
229
229
  end
@@ -274,13 +274,12 @@ module CapistranoMulticonfigParallel
274
274
  end
275
275
 
276
276
  def worker_died(worker, reason)
277
- debug("worker with mailbox #{worker.mailbox.inspect} died for reason: #{reason}") if self.class.debug_enabled?
278
277
  job = @worker_to_job[worker.mailbox.address]
279
- debug job.inspect if self.class.debug_enabled?
278
+ debug("worker job #{job} with mailbox #{worker.mailbox.inspect} died for reason: #{reason}") if self.class.debug_enabled?
280
279
  @worker_to_job.delete(worker.mailbox.address)
281
- debug "restarting #{job} on new worker" if self.class.debug_enabled?
282
280
  return if job.blank? || job_failed?(job)
283
281
  return unless job['action_name'] == 'deploy'
282
+ debug "restarting #{job} on new worker" if self.class.debug_enabled?
284
283
  job = job.merge(:action => 'deploy:rollback', 'worker_action' => 'worker_died')
285
284
  delegate(job)
286
285
  end
@@ -124,7 +124,7 @@ module CapistranoMulticonfigParallel
124
124
  end
125
125
 
126
126
  def check_gitflow
127
- return if !@env_name == 'staging' || !@manager.can_tag_staging? || !executed_task?(CapistranoMulticonfigParallel::GITFLOW_VERIFY_UPTODATE_TASK)
127
+ return if dry_running? || @env_name != 'staging' || !@manager.can_tag_staging? || !executed_task?(CapistranoMulticonfigParallel::GITFLOW_TAG_STAGING_TASK)
128
128
  @manager.dispatch_new_job(@job.merge('env' => 'production'))
129
129
  end
130
130
 
@@ -154,7 +154,7 @@ module CapistranoMulticonfigParallel
154
154
  end
155
155
 
156
156
  def executed_task?(task)
157
- @rake_tasks.present? && @rake_tasks[task].present?
157
+ rake_tasks.present? && rake_tasks.index(task.to_s).present?
158
158
  end
159
159
 
160
160
  def task_approval(message)
@@ -168,7 +168,6 @@ module CapistranoMulticonfigParallel
168
168
  end
169
169
 
170
170
  def save_tasks_to_be_executed(message)
171
- return unless message['action'] == 'count'
172
171
  debug("worler #{@job_id} current invocation chain : #{rake_tasks.inspect}") if debug_enabled?
173
172
  rake_tasks << message['task'] if rake_tasks.last != message['task']
174
173
  end
@@ -249,7 +248,6 @@ module CapistranoMulticonfigParallel
249
248
  end
250
249
 
251
250
  def notify_finished(exit_status)
252
- return unless @execute_deploy
253
251
  if exit_status.exitstatus != 0
254
252
  debug("worker #{job_id} tries to terminate") if debug_enabled?
255
253
  raise(CapistranoMulticonfigParallel::CelluloidWorker::TaskFailed, "task failed with exit status #{exit_status.inspect} ") # force worker to rollback
@@ -48,7 +48,7 @@ module CapistranoMulticonfigParallel
48
48
 
49
49
  def check_exit_status
50
50
  return unless @exit_status.present?
51
- if @options[:dry_run]
51
+ if @exit_status.exitstatus == 0 && @options[:dry_run]
52
52
  debug("worker #{@actor.job_id} starts execute deploy") if @debug_enabled
53
53
  @actor.async.execute_deploy
54
54
  elsif !@actor.worker_finshed?
@@ -142,9 +142,9 @@ module CapistranoMulticonfigParallel
142
142
  def printing_question?(data)
143
143
  get_question_details(data).present?
144
144
  end
145
-
145
+
146
146
  def user_prompt_needed?(data)
147
- return unless printing_question?(data)
147
+ return if !printing_question?(data) || @action != "invoke"
148
148
 
149
149
  details = get_question_details(data)
150
150
  default = details.second.present? ? details.second : nil
@@ -140,7 +140,7 @@ module CapistranoMulticonfigParallel
140
140
  total_tasks = worker_dry_running?(worker) ? nil : tasks.size
141
141
  task_index = worker_dry_running?(worker) ? 0 : tasks.index(current_task.to_s).to_i + 1
142
142
  percent = percent_of(task_index, total_tasks)
143
- result = worker_dry_running?(worker) ? "Please wait.. building the progress bars" : "Progress [#{sprintf('%.2f', percent)}%] (#{task_index} of #{total_tasks})"
143
+ result = worker_dry_running?(worker) ? "Please wait.. building the progress bars" : "Progress [#{sprintf('%.2f', percent)}%] (executed #{task_index} of #{total_tasks})"
144
144
  if worker.alive?
145
145
  worker.crashed? ? result.red : result.green
146
146
  else
@@ -8,7 +8,7 @@ module CapistranoMulticonfigParallel
8
8
  module VERSION
9
9
  MAJOR = 0
10
10
  MINOR = 11
11
- TINY = 2
11
+ TINY = 3
12
12
  PRE = nil
13
13
 
14
14
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano_multiconfig_parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-14 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid-pmap