smartcloud 0.0.179 → 0.0.180
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smartcloud/grids/buildpacker.rb +10 -3
- data/lib/smartcloud/grids/runner.rb +18 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d99f52b901768f9b2f528e164dd7b73193639062faca90bf85afe5c39530ea59
|
4
|
+
data.tar.gz: ba422d333a7bdbd6b4462afd54316dc5e76b7bdab5ecd1c22924dca5204e509e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44700ca49b1c8bfae9b8c58db309cb48229905ea62c8d4305d0fad3c8c5d306ba244caa44ca5df2f0059240452aa0faadcaf6ff604572607c520e35a120d66ed
|
7
|
+
data.tar.gz: dbec0cdc6106064832ba60dfdf3528e48aa6e6d3293b5ca1b079c94cbfeb76a761c1378b8bcfa235de33aaa3313ad71ffcfb6d618a60c06c262a8c83c245ebf8
|
@@ -84,14 +84,21 @@ module Smartcloud
|
|
84
84
|
|
85
85
|
def set_logger_formatter_arrow
|
86
86
|
logger.formatter = proc do |severity, datetime, progname, message|
|
87
|
-
severity_text = (severity == 'INFO') ? "" : "#{severity}:"
|
88
|
-
|
87
|
+
severity_text = (severity == 'INFO') ? "" : "#{severity}: "
|
88
|
+
|
89
|
+
SYMBOL_DEBUG = "\u{1f527}"
|
90
|
+
SYMBOL_INFO = "\u{1f604}"
|
91
|
+
SYMBOL_WARN = "\u{2753}"
|
92
|
+
SYMBOL_ERROR, SYMBOL_FATAL = "\u{274c}"
|
93
|
+
symbol_text = (message == "") ? "" : Object.const_get("SYMBOL_#{severity}")
|
94
|
+
|
95
|
+
"\t\t\t\t#{symbol_text} #{severity_text}#{message}\n"
|
89
96
|
end
|
90
97
|
end
|
91
98
|
|
92
99
|
def set_logger_formatter_tabs
|
93
100
|
logger.formatter = proc do |severity, datetime, progname, message|
|
94
|
-
"\t\t\t\t
|
101
|
+
"\t\t\t\t #{message}"
|
95
102
|
end
|
96
103
|
end
|
97
104
|
end
|
@@ -220,8 +220,15 @@ module Smartcloud
|
|
220
220
|
|
221
221
|
def self.prereceive_app(appname, username, oldrev, newrev, refname)
|
222
222
|
logger.formatter = proc do |severity, datetime, progname, message|
|
223
|
-
severity_text = (severity == 'INFO') ? "" : "#{severity}:"
|
224
|
-
|
223
|
+
severity_text = (severity == 'INFO') ? "" : "#{severity}: "
|
224
|
+
|
225
|
+
SYMBOL_DEBUG = "\u{1f527}"
|
226
|
+
SYMBOL_INFO = "\u{1f604}"
|
227
|
+
SYMBOL_WARN = "\u{2753}"
|
228
|
+
SYMBOL_ERROR, SYMBOL_FATAL = "\u{274c}"
|
229
|
+
symbol_text = (message == "") ? "" : Object.const_get("SYMBOL_#{severity}")
|
230
|
+
|
231
|
+
"\t\t\t\t#{symbol_text} #{severity_text}#{message}\n"
|
225
232
|
end
|
226
233
|
|
227
234
|
# Load vars and environment
|
@@ -338,14 +345,14 @@ module Smartcloud
|
|
338
345
|
system("docker network connect solr-network #{appname}_new")
|
339
346
|
system("docker network connect mysql-network #{appname}_new")
|
340
347
|
|
341
|
-
system("docker start --attach #{appname}_new")
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
348
|
+
if system("docker start --attach #{appname}_new")
|
349
|
+
# Runs only if #{appname}_new has been started successfully and is reachable.
|
350
|
+
self.hot_reloaded_app(appname)
|
351
|
+
self.clean_up(container_path)
|
352
|
+
else
|
353
|
+
# Runs only if #{appname}_new starting has failed.
|
354
|
+
self.stop_app("#{appname}_new")
|
355
|
+
end
|
349
356
|
end
|
350
357
|
end
|
351
358
|
|
@@ -366,7 +373,7 @@ module Smartcloud
|
|
366
373
|
end
|
367
374
|
|
368
375
|
# Hot reloading app containers and removing old app container
|
369
|
-
def self.
|
376
|
+
def self.hot_reloaded_app(appname)
|
370
377
|
logger.debug "Hot reloading '#{appname}' containers ..."
|
371
378
|
|
372
379
|
container_id = `docker ps -a -q --filter='name=^#{appname}$'`.chomp
|