capistrano_multiconfig_parallel 0.19.0 → 0.19.1

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: c16a337397b541e4bed172a5abda0ad5b625d81b
4
- data.tar.gz: 2d452cdd7abcb3b9f7cbad1e134b6a6199cab0e9
3
+ metadata.gz: c9288749bda2f195986a76d1a374bb524480f2b4
4
+ data.tar.gz: 999412e591c8bcd8aef5c6953a7792571640bdaf
5
5
  SHA512:
6
- metadata.gz: 5f6537946ef0fa1a9a70ad8aea9a255a5db0b85c4ed019f565f443b4079067d1650d353f53b13b62f5c157e7c2299462a5d2a9083f0c615f9ca4105826623300
7
- data.tar.gz: 2c59e8ba2d189d3c757de7c4567629f16dba74933c0ddd1be57f3607f000420805e354cacaf7299926b6a2f89d785fd143abe30dc8b7b52ea65620cca1503bad
6
+ metadata.gz: 60a457c3d9a565b56221c6cd716b06d117d4b519b9a2341d6e5b926b1b5a300ba07683fafb2c6ba6cdd7ea8a93c06ebad2db0f8ee3db7e9d8d70769507fb9361
7
+ data.tar.gz: 7d1cf484b0489687ddd5ce4ce80199701229bd5947cabd5033fa09a6ed654ccd5540998ce75f955885fdcd0a658367818d3d56da1d7dee872f6b0a97ca39f170
data/Gemfile.lock CHANGED
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano_multiconfig_parallel (0.18.1)
4
+ capistrano_multiconfig_parallel (0.19.0)
5
5
  activesupport (~> 4.0, >= 4.0)
6
6
  capistrano (~> 3.0, >= 3.0)
7
7
  celluloid-pmap (~> 0.2, >= 0.2.2)
8
- celluloid_pubsub (~> 0.0, >= 0.0.21)
8
+ celluloid_pubsub (~> 0.0, >= 0.0.22)
9
9
  colorize (~> 0.7, >= 0.7)
10
10
  composable_state_machine (~> 1.0, >= 1.0.2)
11
11
  configliere (~> 0.4, >= 0.4)
@@ -42,7 +42,7 @@ GEM
42
42
  adamantium (0.2.0)
43
43
  ice_nine (~> 0.11.0)
44
44
  memoizable (~> 0.4.0)
45
- addressable (2.3.8)
45
+ addressable (2.4.0)
46
46
  ast (2.1.0)
47
47
  astrolabe (1.3.1)
48
48
  parser (~> 2.2)
@@ -66,11 +66,12 @@ GEM
66
66
  celluloid-websocket-client (0.0.1)
67
67
  celluloid-io
68
68
  websocket-protocol
69
- celluloid_pubsub (0.0.21)
69
+ celluloid_pubsub (0.0.22)
70
70
  activesupport (~> 4.1, >= 4.1.0)
71
71
  celluloid (~> 0.16.0, ~> 0.16)
72
72
  celluloid-io (~> 0.16, >= 0.16.2)
73
73
  celluloid-websocket-client (= 0.0.1)
74
+ http (~> 0.9.8, >= 0.9.8)
74
75
  reel (~> 0.5, >= 0.5.0)
75
76
  codeclimate-engine-rb (0.1.0)
76
77
  virtus (~> 1.0)
@@ -263,8 +264,7 @@ GEM
263
264
  simplecov
264
265
  slop (3.6.0)
265
266
  sparkr (0.4.1)
266
- sshkit (1.7.1)
267
- colorize (>= 0.7.0)
267
+ sshkit (1.8.1)
268
268
  net-scp (>= 1.1.2)
269
269
  net-ssh (>= 2.8.0)
270
270
  term-ansicolor (1.3.2)
@@ -111,7 +111,7 @@ module CapistranoMulticonfigParallel
111
111
  return unless @jobs.present?
112
112
  FileUtils.rm Dir["#{log_directory}/worker_*.log"]
113
113
  if app_configuration.multi_secvential.to_s.downcase == 'true'
114
- @jobs.each { |job| job.execute_standard_deploy }
114
+ @jobs.each(&:execute_standard_deploy)
115
115
  else
116
116
  run_async_jobs
117
117
  end
@@ -220,8 +220,8 @@ module CapistranoMulticonfigParallel
220
220
  job_env_options = custom_command? && env_options['ACTION'].present? ? env_options.except('ACTION') : env_options
221
221
 
222
222
  job = CapistranoMulticonfigParallel::Job.new(options.merge(
223
- action: custom_command? && env_options['ACTION'].present? ? env_options['ACTION'] : options['action'],
224
- env_options: job_env_options
223
+ action: custom_command? && env_options['ACTION'].present? ? env_options['ACTION'] : options['action'],
224
+ env_options: job_env_options
225
225
  ))
226
226
  @jobs << job
227
227
  end
@@ -89,7 +89,7 @@ module CapistranoMulticonfigParallel
89
89
  end
90
90
 
91
91
  def apply_confirmation_for_job(job)
92
- app_configuration.apply_stage_confirmation.include?(job.stage) && apply_confirmations?
92
+ app_configuration.apply_stage_confirmation.include?(job.stage) && apply_confirmations?
93
93
  end
94
94
 
95
95
  def setup_worker_conditions(job)
@@ -153,17 +153,17 @@ module CapistranoMulticonfigParallel
153
153
  apps_symlink_confirmation
154
154
  end
155
155
 
156
- def confirm_task_approval(result, task, job = nil)
156
+ def confirm_task_approval(result, task, processed_job = nil)
157
157
  return unless result.present?
158
- result = print_confirm_task_approvall(result, task, job)
158
+ result = print_confirm_task_approvall(result, task, processed_job)
159
159
  return if result.blank? || result.downcase != 'y'
160
160
  @jobs.pmap do |job_id, job|
161
161
  worker = get_worker_for_job(job_id)
162
162
  worker.publish_rake_event('approved' => 'yes',
163
- 'action' => 'invoke',
164
- 'job_id' => job.id,
165
- 'task' => task
166
- )
163
+ 'action' => 'invoke',
164
+ 'job_id' => job.id,
165
+ 'task' => task
166
+ )
167
167
  end
168
168
  end
169
169
 
@@ -182,7 +182,7 @@ module CapistranoMulticonfigParallel
182
182
 
183
183
  def can_tag_staging?
184
184
  @job_manager.can_tag_staging? &&
185
- @jobs.find { |_job_id, job| job['env'] == 'production' }.blank?
185
+ @jobs.find { |_job_id, job| job['env'] == 'production' }.blank?
186
186
  end
187
187
 
188
188
  def dispatch_new_job(job, options = {})
@@ -224,7 +224,7 @@ module CapistranoMulticonfigParallel
224
224
  return unless job.action == 'deploy'
225
225
  log_to_file "restarting #{job} on new worker"
226
226
  job.status = 'worker_died'
227
- dispatch_new_job(job, :action => 'deploy:rollback')
227
+ dispatch_new_job(job, action: 'deploy:rollback')
228
228
  end
229
229
  end
230
230
  end
@@ -51,8 +51,8 @@ module CapistranoMulticonfigParallel
51
51
  @client.publish(rake_actor_id(data), data)
52
52
  end
53
53
 
54
- def rake_actor_id(data)
55
- "rake_worker_#{@job_id}"
54
+ def rake_actor_id(_data)
55
+ "rake_worker_#{@job_id}"
56
56
  end
57
57
 
58
58
  def on_message(message)
@@ -77,8 +77,6 @@ module CapistranoMulticonfigParallel
77
77
  @invocation_chain ||= []
78
78
  end
79
79
 
80
-
81
-
82
80
  def execute_deploy
83
81
  log_to_file("invocation chain #{@job_id} is : #{@rake_tasks.inspect}")
84
82
  check_child_proces
@@ -103,7 +101,7 @@ module CapistranoMulticonfigParallel
103
101
 
104
102
  def check_gitflow
105
103
  return if @job.stage != 'staging' || !@manager.can_tag_staging? || !executed_task?(CapistranoMulticonfigParallel::GITFLOW_TAG_STAGING_TASK)
106
- @manager.dispatch_new_job(@job,'env' => 'production')
104
+ @manager.dispatch_new_job(@job, 'env' => 'production')
107
105
  end
108
106
 
109
107
  def handle_subscription(message)
@@ -157,7 +155,6 @@ module CapistranoMulticonfigParallel
157
155
  abort(CapistranoMulticonfigParallel::CelluloidWorker::TaskFailed.new("task #{@action} failed ")) if name == 'deploy:failed' # force worker to rollback
158
156
  end
159
157
 
160
-
161
158
  def send_msg(channel, message = nil)
162
159
  publish channel, message.present? && message.is_a?(Hash) ? { job_id: @job_id }.merge(message) : { job_id: @job_id, time: Time.now }
163
160
  end
@@ -168,7 +165,6 @@ module CapistranoMulticonfigParallel
168
165
  @manager.workers_terminated.signal('completed') if @manager.alive? && @manager.all_workers_finished?
169
166
  end
170
167
 
171
-
172
168
  def notify_finished(exit_status)
173
169
  if exit_status != 0
174
170
  log_to_file("worker #{job_id} tries to terminate")
@@ -9,7 +9,7 @@ module CapistranoMulticonfigParallel
9
9
 
10
10
  attr_accessor :options, :actor, :job_id, :exit_status, :pid, :process, :job
11
11
 
12
- finalizer :process_finalizer
12
+ finalizer :process_finalizer
13
13
 
14
14
  def work(job, cmd, options = {})
15
15
  @options = options
@@ -21,7 +21,7 @@ module CapistranoMulticonfigParallel
21
21
 
22
22
  def custom_attributes
23
23
  @publisher_channel = "worker_#{@job_id}"
24
- @action = 'invoke'
24
+ @action = 'invoke'
25
25
  @task = @options['task']
26
26
  end
27
27
 
@@ -33,7 +33,7 @@ module CapistranoMulticonfigParallel
33
33
  last_job_id = @manager.jobs.keys.last.to_i
34
34
  @manager.jobs.each do |job_id, job|
35
35
  count += 1
36
- add_job_to_table(table, job_id, job, count, last_job_id)
36
+ add_job_to_table(table, job_id, job, count, last_job_id)
37
37
  end
38
38
  end
39
39
  show_terminal_screen(table)
@@ -73,8 +73,7 @@ module CapistranoMulticonfigParallel
73
73
  end
74
74
  end
75
75
 
76
-
77
- def get_worker_details(job_id, job, worker)
76
+ def get_worker_details(job_id, job, worker)
78
77
  {
79
78
  'job_id' => job_id,
80
79
  'app_name' => job.app,
@@ -130,7 +129,7 @@ module CapistranoMulticonfigParallel
130
129
  percent = percent_of(task_index, total_tasks)
131
130
  result = "Progress [#{format('%.2f', percent)}%] (executed #{task_index} of #{total_tasks})"
132
131
  if worker.alive?
133
- @manager.job_crashed?(processed_job) ? result.red : result.green
132
+ @manager.job_crashed?(processed_job) ? result.red : result.green
134
133
  else
135
134
  worker_state(worker)
136
135
  end
@@ -27,7 +27,6 @@ module CapistranoMulticonfigParallel
27
27
  applications = []
28
28
  end
29
29
  applications
30
-
31
30
  end
32
31
 
33
32
  private
@@ -46,7 +45,7 @@ module CapistranoMulticonfigParallel
46
45
  def all_websites_return_applications_selected
47
46
  interactive_menu = CapistranoMulticonfigParallel::InteractiveMenu.new
48
47
  applications_selected = interactive_menu.show_all_websites_interactive_menu(available_apps)
49
- applications_selected.present? ? applications_selected.split(',') : []
48
+ applications_selected.present? ? applications_selected.split(',') : []
50
49
  end
51
50
 
52
51
  def add_dependency_app(app_to_deploy, apps_dependencies, applications_to_deploy)
@@ -51,11 +51,10 @@ module CapistranoMulticonfigParallel
51
51
 
52
52
  def build_capistrano_task(action = nil, env = [])
53
53
  action = action.present? ? action : @action
54
- environment_options = setup_command_line_standard(env).join(" ")
54
+ environment_options = setup_command_line_standard(env).join(' ')
55
55
  "cd #{detect_root} && RAILS_ENV=#{@stage} bundle exec multi_cap #{job_stage} #{capistrano_action(action)} #{environment_options}"
56
56
  end
57
57
 
58
-
59
58
  def execute_standard_deploy(action = nil)
60
59
  command = build_capistrano_task(action)
61
60
  puts("\n\n\n Executing '#{command}' \n\n\n .")
@@ -66,8 +65,7 @@ module CapistranoMulticonfigParallel
66
65
  end
67
66
 
68
67
  def to_s
69
- self.to_json
68
+ to_json
70
69
  end
71
-
72
70
  end
73
71
  end
@@ -8,7 +8,7 @@ module CapistranoMulticonfigParallel
8
8
  module VERSION
9
9
  MAJOR = 0
10
10
  MINOR = 19
11
- TINY = 0
11
+ TINY = 1
12
12
  PRE = nil
13
13
 
14
14
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano_multiconfig_parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada