capistrano_multiconfig_parallel 0.26.0 → 0.27.0
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/celluloid/celluloid_worker.rb +1 -1
- data/lib/capistrano_multiconfig_parallel/celluloid/rake_worker.rb +1 -1
- data/lib/capistrano_multiconfig_parallel/configuration/default.yml +7 -0
- data/lib/capistrano_multiconfig_parallel/helpers/core_helper.rb +2 -0
- data/lib/capistrano_multiconfig_parallel/helpers/internal_helper.rb +9 -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: c2bedeebfd42524af07a4fa566e3ce392fc5e4cf
|
4
|
+
data.tar.gz: 916e61cd649f9190533cc64d886ce9da8930f03f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f47bbdfc7f0f447a0443ff7312875e7d1a4147f22bfbdd36239fb0d79b5ba8efbd465b92d08943fc74db69fd07a1c47f92d235b626b6ea1a7108e76263b63d0
|
7
|
+
data.tar.gz: 8bd55994be361d87eef6951ec6e77fdc85c798f6c69e30c64aa61e5e7953128b572e03aedb5bde2a6c4ea00592533828123af81191a31d17e6a6cc5b135f32ba
|
@@ -52,7 +52,7 @@ module CapistranoMulticonfigParallel
|
|
52
52
|
|
53
53
|
def start_task
|
54
54
|
log_to_file("exec worker #{@job_id} starts task")
|
55
|
-
@client = CelluloidPubsub::Client.new(actor: Actor.current, enable_debug: debug_websocket?, channel: subscription_channel)
|
55
|
+
@client = CelluloidPubsub::Client.new(actor: Actor.current, enable_debug: debug_websocket?, channel: subscription_channel, log_file_path: websocket_config.fetch('log_file_path', nil))
|
56
56
|
end
|
57
57
|
|
58
58
|
def publish_rake_event(data)
|
@@ -51,7 +51,7 @@ module CapistranoMulticonfigParallel
|
|
51
51
|
|
52
52
|
def initialize_subscription
|
53
53
|
return if defined?(@client) && @client.present?
|
54
|
-
@client = CelluloidPubsub::Client.new(actor: Actor.current, enable_debug: debug_websocket?, channel: @subscription_channel)
|
54
|
+
@client = CelluloidPubsub::Client.new(actor: Actor.current, enable_debug: debug_websocket?, channel: @subscription_channel, log_file_path: websocket_config.fetch('log_file_path', nil))
|
55
55
|
end
|
56
56
|
|
57
57
|
def task_name
|
@@ -27,6 +27,13 @@ default_config:
|
|
27
27
|
default: 'false'
|
28
28
|
required: false
|
29
29
|
|
30
|
+
- name: 'websocket_server.log_file_path'
|
31
|
+
type: 'filename'
|
32
|
+
description: >-
|
33
|
+
Enables the logging of websocket communication into a different file
|
34
|
+
default: './log/multi_cap_websocket.log'
|
35
|
+
required: false
|
36
|
+
|
30
37
|
- name: 'development_stages'
|
31
38
|
type: 'Array'
|
32
39
|
description: >-
|
@@ -97,6 +97,8 @@ module CapistranoMulticonfigParallel
|
|
97
97
|
end
|
98
98
|
|
99
99
|
def websocket_config
|
100
|
+
raise websocket_server_config.inspect
|
101
|
+
create_log_file(websocket_server_config.fetch('log_file_path', nil)) if debug_websocket?
|
100
102
|
websocket_server_config.merge('enable_debug' => debug_websocket?, 'use_redis' => false)
|
101
103
|
end
|
102
104
|
|
@@ -50,7 +50,7 @@ module CapistranoMulticonfigParallel
|
|
50
50
|
|
51
51
|
def find_config_type(type)
|
52
52
|
type = type.to_s
|
53
|
-
['boolean'].include?(type) ? type.delete(':').to_sym : type.constantize
|
53
|
+
['boolean', 'filename'].include?(type) ? type.delete(':').to_sym : type.constantize
|
54
54
|
end
|
55
55
|
|
56
56
|
def find_env_multi_cap_root
|
@@ -118,9 +118,15 @@ module CapistranoMulticonfigParallel
|
|
118
118
|
['deploy_multi_stages']
|
119
119
|
end
|
120
120
|
|
121
|
+
def create_log_file(file_path)
|
122
|
+
return if file_path.blank?
|
123
|
+
directory = File.dirname(file_path)
|
124
|
+
FileUtils.mkdir_p(directory) unless File.directory?(directory)
|
125
|
+
FileUtils.touch(file_path) unless File.file?(file_path)
|
126
|
+
end
|
127
|
+
|
121
128
|
def enable_main_log_file
|
122
|
-
|
123
|
-
FileUtils.touch(main_log_file) unless File.file?(main_log_file)
|
129
|
+
create_log_file(main_log_file)
|
124
130
|
log_file = File.open(main_log_file, 'w')
|
125
131
|
log_file.sync = true
|
126
132
|
end
|