capistrano_multiconfig_parallel 0.12.1 → 0.12.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 788c14a8757342d82a178672d1fbd0a853159538
|
4
|
+
data.tar.gz: d401ebfc5b7712a78f1cb7cc66e0ffe3cdede58c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ccc2e45aa9916f7ca7c2d487fab2f915bf9203165e988378fb9d30d07a0cb0d3f8fcfbbdc306d6ceca2398f6edc907ebc2271ce14e1d2a1482810bb05075c89
|
7
|
+
data.tar.gz: 39b87f2d84a6b2d2d38c02a78dcc8eec68f35bc24b90ff0630c92ef8969be7b768977c815960433c75d916c32b80986dbba82367676e7727be6bdff03a29e75d
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
19
|
|
20
20
|
s.add_runtime_dependency 'celluloid-pmap', '~> 0.2', '>= 0.2.0'
|
21
|
-
s.add_runtime_dependency 'celluloid_pubsub', '~> 0.0', '>= 0.0.
|
21
|
+
s.add_runtime_dependency 'celluloid_pubsub', '~> 0.0', '>= 0.0.21'
|
22
22
|
s.add_runtime_dependency 'composable_state_machine', '~> 1.0', '>= 1.0.2'
|
23
23
|
s.add_runtime_dependency 'terminal-table', '~> 1.4', '>= 1.4.5'
|
24
24
|
s.add_runtime_dependency 'colorize', '~> 0.7', '>= 0.7'
|
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
s.add_runtime_dependency 'activesupport', '~> 4.0','>= 4.0'
|
30
30
|
s.add_runtime_dependency 'configliere', '~> 0.4', '>=0.4'
|
31
31
|
s.add_runtime_dependency 'inquirer', '~> 0.2', '>= 0.2'
|
32
|
-
|
32
|
+
s.add_runtime_dependency 'devnull','~> 0.1', '>= 0.1'
|
33
33
|
|
34
34
|
s.add_development_dependency 'rspec-rails', '~> 2.0', '>= 2.0'
|
35
35
|
s.add_development_dependency 'guard', '~> 2.6', '>= 2.6.1'
|
@@ -26,7 +26,7 @@ module CapistranoMulticonfigParallel
|
|
26
26
|
:rake_tasks, :current_task_number, # tracking tasks
|
27
27
|
:successfull_subscription, :subscription_channel, :publisher_channel, # for subscriptions and publishing events
|
28
28
|
:job_termination_condition, :worker_state, :executing_dry_run, :job_argv, :dry_run_tasks
|
29
|
-
|
29
|
+
|
30
30
|
def work(job, manager)
|
31
31
|
@job = job
|
32
32
|
@worker_state = 'started'
|
@@ -47,15 +47,13 @@ module CapistranoMulticonfigParallel
|
|
47
47
|
def start_task
|
48
48
|
@manager.setup_worker_conditions(Actor.current)
|
49
49
|
debug("exec worker #{@job_id} starts task with #{@job.inspect}") if debug_enabled?
|
50
|
-
@client = CelluloidPubsub::Client.connect(actor: Actor.current, enable_debug: @manager.class.debug_websocket
|
51
|
-
ws.subscribe(@subscription_channel)
|
52
|
-
end
|
50
|
+
@client = CelluloidPubsub::Client.connect(actor: Actor.current, enable_debug: @manager.class.debug_websocket?, :channel => subscription_channel)
|
53
51
|
end
|
54
52
|
|
55
53
|
def publish_rake_event(data)
|
56
54
|
@client.publish(rake_actor_id(data), data)
|
57
55
|
end
|
58
|
-
|
56
|
+
|
59
57
|
|
60
58
|
def rake_actor_id(data)
|
61
59
|
data['action'].present? && data['action'] == 'count' ? "rake_worker_#{@job_id}_count" : "rake_worker_#{@job_id}"
|
@@ -78,7 +76,7 @@ module CapistranoMulticonfigParallel
|
|
78
76
|
def rake_tasks
|
79
77
|
@rake_tasks ||= []
|
80
78
|
end
|
81
|
-
|
79
|
+
|
82
80
|
def dry_run_tasks
|
83
81
|
@dry_run_tasks ||= []
|
84
82
|
end
|
@@ -95,7 +93,7 @@ module CapistranoMulticonfigParallel
|
|
95
93
|
|
96
94
|
def execute_deploy
|
97
95
|
@execute_deploy = true
|
98
|
-
debug("invocation chain #{@job_id} is : #{@rake_tasks.inspect}") if debug_enabled?
|
96
|
+
debug("invocation chain #{@job_id} is : #{@rake_tasks.inspect}") if debug_enabled?
|
99
97
|
check_child_proces
|
100
98
|
setup_task_arguments
|
101
99
|
debug("worker #{@job_id} executes: #{generate_command}") if debug_enabled?
|
@@ -142,7 +140,7 @@ module CapistranoMulticonfigParallel
|
|
142
140
|
def message_is_for_stdout?(message)
|
143
141
|
message.present? && message.is_a?(Hash) && message['action'].present? && message['job_id'].present? && message['action'] == 'stdout'
|
144
142
|
end
|
145
|
-
|
143
|
+
|
146
144
|
def message_is_about_a_task?(message)
|
147
145
|
message.present? && message.is_a?(Hash) && message['action'].present? && message['job_id'].present? && message['task'].present?
|
148
146
|
end
|
@@ -163,8 +161,8 @@ module CapistranoMulticonfigParallel
|
|
163
161
|
|
164
162
|
def save_tasks_to_be_executed(message)
|
165
163
|
debug("worler #{@job_id} current invocation chain : #{rake_tasks.inspect}") if debug_enabled?
|
166
|
-
rake_tasks << message['task'] if rake_tasks.last != message['task']
|
167
|
-
dry_run_tasks << message['task'] if dry_running? && dry_run_tasks.last != message['task']
|
164
|
+
rake_tasks << message['task'] if rake_tasks.last != message['task']
|
165
|
+
dry_run_tasks << message['task'] if dry_running? && dry_run_tasks.last != message['task']
|
168
166
|
end
|
169
167
|
|
170
168
|
def update_machine_state(name)
|
@@ -181,19 +179,19 @@ module CapistranoMulticonfigParallel
|
|
181
179
|
end
|
182
180
|
@task_argv
|
183
181
|
end
|
184
|
-
|
182
|
+
|
185
183
|
def dry_run_command
|
186
184
|
'--dry-run'
|
187
185
|
end
|
188
|
-
|
186
|
+
|
189
187
|
def dry_running?
|
190
188
|
@task_argv.include?(dry_run_command) == true
|
191
189
|
end
|
192
|
-
|
190
|
+
|
193
191
|
def worker_stage
|
194
192
|
@app_name.present? ? "#{@app_name}:#{@env_name}" : "#{@env_name}"
|
195
193
|
end
|
196
|
-
|
194
|
+
|
197
195
|
def worker_action
|
198
196
|
"#{@action_name}[#{@task_arguments.join(',')}]"
|
199
197
|
end
|
@@ -237,7 +235,7 @@ module CapistranoMulticonfigParallel
|
|
237
235
|
@manager.jobs[@job_id]['worker_action'] = 'finished'
|
238
236
|
@manager.workers_terminated.signal('completed') if @manager.all_workers_finished?
|
239
237
|
end
|
240
|
-
|
238
|
+
|
241
239
|
def worker_finshed?
|
242
240
|
@manager.jobs[@job_id]['worker_action'] == 'finished'
|
243
241
|
end
|
@@ -4,7 +4,7 @@ module CapistranoMulticonfigParallel
|
|
4
4
|
include Celluloid
|
5
5
|
include Celluloid::Logger
|
6
6
|
|
7
|
-
attr_accessor :env, :client, :job_id, :action, :task,
|
7
|
+
attr_accessor :env, :client, :job_id, :action, :task,
|
8
8
|
:task_approved, :successfull_subscription,
|
9
9
|
:subscription_channel, :publisher_channel, :stdin_result
|
10
10
|
|
@@ -50,9 +50,8 @@ module CapistranoMulticonfigParallel
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def initialize_subscription
|
53
|
-
@client
|
54
|
-
|
55
|
-
end if !defined?(@client) || @client.nil?
|
53
|
+
return if defined?(@client) && @client.present?
|
54
|
+
@client = CelluloidPubsub::Client.connect(actor: Actor.current, enable_debug: debug_enabled?, :channel => @subscription_channel )
|
56
55
|
end
|
57
56
|
|
58
57
|
def debug_enabled?
|
@@ -82,7 +81,7 @@ module CapistranoMulticonfigParallel
|
|
82
81
|
debug("Rake worker #{@job_id} received parse #{message}") if debug_enabled?
|
83
82
|
@successfull_subscription = true
|
84
83
|
publish_to_worker(task_data)
|
85
|
-
elsif message.present? && message['task'].present?
|
84
|
+
elsif message.present? && message['task'].present?
|
86
85
|
task_approval(message)
|
87
86
|
elsif message.present? && message['action'].present? && message['action'] == 'stdin'
|
88
87
|
stdin_approval(message)
|
@@ -96,9 +95,9 @@ module CapistranoMulticonfigParallel
|
|
96
95
|
end
|
97
96
|
|
98
97
|
def publish_subscription_successfull
|
99
|
-
|
98
|
+
|
100
99
|
end
|
101
|
-
|
100
|
+
|
102
101
|
def wait_for_stdin_input
|
103
102
|
until @stdin_result.present?
|
104
103
|
wait_execution
|
@@ -107,7 +106,7 @@ module CapistranoMulticonfigParallel
|
|
107
106
|
Actor.current.stdin_result = nil
|
108
107
|
output
|
109
108
|
end
|
110
|
-
|
109
|
+
|
111
110
|
def stdin_approval(message)
|
112
111
|
if @job_id.to_i == message['job_id'].to_i && message['result'].present? && message['action'] == 'stdin'
|
113
112
|
@stdin_result = message['result']
|
@@ -128,7 +127,7 @@ module CapistranoMulticonfigParallel
|
|
128
127
|
debug("websocket connection closed: #{code.inspect}, #{reason.inspect}") if debug_enabled?
|
129
128
|
terminate
|
130
129
|
end
|
131
|
-
|
130
|
+
|
132
131
|
def get_question_details(data)
|
133
132
|
question = ''
|
134
133
|
default = nil
|
@@ -142,10 +141,10 @@ module CapistranoMulticonfigParallel
|
|
142
141
|
def printing_question?(data)
|
143
142
|
get_question_details(data).present?
|
144
143
|
end
|
145
|
-
|
144
|
+
|
146
145
|
def user_prompt_needed?(data)
|
147
146
|
return if !printing_question?(data) || @action != "invoke"
|
148
|
-
|
147
|
+
|
149
148
|
details = get_question_details(data)
|
150
149
|
default = details.second.present? ? details.second : nil
|
151
150
|
publish_to_worker({
|
@@ -155,9 +154,9 @@ module CapistranoMulticonfigParallel
|
|
155
154
|
job_id: @job_id
|
156
155
|
})
|
157
156
|
wait_for_stdin_input
|
158
|
-
|
157
|
+
|
159
158
|
end
|
160
|
-
|
161
|
-
|
159
|
+
|
160
|
+
|
162
161
|
end
|
163
162
|
end
|
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.12.
|
4
|
+
version: 0.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bogdanRada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid-pmap
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: '0.0'
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.0.
|
42
|
+
version: 0.0.21
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
version: '0.0'
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 0.0.
|
52
|
+
version: 0.0.21
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: composable_state_machine
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|