capistrano_sentinel 0.0.8 → 0.0.9
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: cb4ca0ce5ab4b0150d14a46992263d9c53da5614
|
4
|
+
data.tar.gz: 6ea5e82079b69f1edb4064fd02cd5ce02c14ce61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 406203038d54b2c42b02a01c74bce08b58add529a24258b01292bf172d79b64206289df08f362af6f63212b93c37a2c927f8c5c3217766a40a85333600c43426
|
7
|
+
data.tar.gz: d6e17b230487451d05de6c48ca8ea26d4ba7e38c929eece3b23bcd27e84363698e3521bb1dc5625c533447ddefb8098f7aec4b94af22af950921c49643641269
|
@@ -104,7 +104,6 @@ module CapistranoSentinel
|
|
104
104
|
return if !message_is_about_a_task?(message)
|
105
105
|
log_to_file("RakeWorker #{@job_id} #{task_name} task_approval : #{message.inspect}")
|
106
106
|
if @job_id.to_s == message['job_id'].to_s && message['task'].to_s == task_name.to_s && message['approved'] == 'yes'
|
107
|
-
show_warning "#{self.inspect} got #{message} and approved"
|
108
107
|
@task_approved = true
|
109
108
|
else
|
110
109
|
show_warning "#{self.inspect} got unknown task_approval #{message} #{task_data}"
|
@@ -3,6 +3,10 @@ module CapistranoSentinel
|
|
3
3
|
module Logging
|
4
4
|
module_function
|
5
5
|
|
6
|
+
def logging_enabled?
|
7
|
+
ENV["WEBSOCKET_LOGGING"].to_s == 'true'
|
8
|
+
end
|
9
|
+
|
6
10
|
def logger
|
7
11
|
@logger ||= ::Logger.new(ENV["LOG_FILE"] || '/dev/null')
|
8
12
|
end
|
@@ -20,7 +24,6 @@ module CapistranoSentinel
|
|
20
24
|
def log_output_error(error, output, message)
|
21
25
|
return if message.blank? || error_filtered?(error)
|
22
26
|
puts message if output.present?
|
23
|
-
terminal_actor.errors.push(message) if terminal_errors?
|
24
27
|
end
|
25
28
|
|
26
29
|
def format_error(exception)
|
@@ -31,6 +34,7 @@ module CapistranoSentinel
|
|
31
34
|
end
|
32
35
|
|
33
36
|
def log_to_file(message, options = {})
|
37
|
+
return unless logging_enabled?
|
34
38
|
worker_log = options.fetch(:job_id, '').present? ? find_worker_log(options[:job_id]) : logger
|
35
39
|
print_to_log_file(worker_log, options.merge(message: message)) if worker_log.present?
|
36
40
|
end
|
@@ -73,7 +77,9 @@ module CapistranoSentinel
|
|
73
77
|
exit(1)
|
74
78
|
end
|
75
79
|
|
80
|
+
def show_warning(message)
|
81
|
+
warn message
|
82
|
+
end
|
76
83
|
|
77
|
-
|
78
|
-
end
|
84
|
+
end
|
79
85
|
end
|