smartcloud 0.0.178 → 0.0.183
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 +7 -6
- data/lib/smartcloud/grids/runner.rb +16 -12
- 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: d3c539dab1e6f0c5b63e0a0c4de873ddce852dd069bb7bd7426cad1502c75d30
|
4
|
+
data.tar.gz: 3e114db0743b4114e0689235fdc0d59ef3aeb5d2c7e397c7a813ddb4a99bb332
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae921b5751e7b60a036440f5a172e90fb5a825d273442954fd3b5eab8dc8af470ff9a202d228e2399ec35fc937ffd963e03df6b7c4922ff25fb5591c1b6cc69b
|
7
|
+
data.tar.gz: 767f764ddb3f8b407e40acf4935af6a29b7c2a851753a781fae93a0a9e812d68ef6ec134053d23476a1b4dceb3451232e2d4e853bb8f4a5cf92d8451116aa429
|
@@ -26,7 +26,6 @@ module Smartcloud
|
|
26
26
|
|
27
27
|
# Perform bundle install
|
28
28
|
def bundle_install?
|
29
|
-
logger.info ""
|
30
29
|
logger.info "Performing bundle install ..."
|
31
30
|
|
32
31
|
set_logger_formatter_tabs
|
@@ -47,7 +46,6 @@ module Smartcloud
|
|
47
46
|
|
48
47
|
# Perform pre-compiling of assets
|
49
48
|
def precompile_assets?
|
50
|
-
logger.info ""
|
51
49
|
logger.info "Installing Javascript dependencies & pre-compiling assets ..."
|
52
50
|
|
53
51
|
set_logger_formatter_tabs
|
@@ -68,14 +66,12 @@ module Smartcloud
|
|
68
66
|
|
69
67
|
# Perform starting of web server
|
70
68
|
def start_web_server?
|
71
|
-
logger.debug ""
|
72
69
|
logger.debug "Starting Web Server ..."
|
73
70
|
|
74
71
|
# Remove server.pid if it exists
|
75
72
|
FileUtils.rm("tmp/pids/server.pid") if File.exist? "tmp/pids/server.pid"
|
76
73
|
|
77
74
|
# if system("god -c Godfile -D")
|
78
|
-
logger.info ""
|
79
75
|
logger.info "Launched Application ... Success."
|
80
76
|
# return true
|
81
77
|
# end
|
@@ -84,8 +80,13 @@ module Smartcloud
|
|
84
80
|
|
85
81
|
def set_logger_formatter_arrow
|
86
82
|
logger.formatter = proc do |severity, datetime, progname, message|
|
87
|
-
severity_text = (severity == 'INFO') ? "" : "#{severity}:"
|
88
|
-
"\
|
83
|
+
severity_text = (severity == 'INFO') ? "" : "#{severity}: "
|
84
|
+
severity_symbols = { "DEBUG" => "\u{1f527}", "INFO" => "\u{276f}",
|
85
|
+
"WARN" => "\u{2757}", "ERROR" => "\u{2b55}", "FATAL" => "\u{274c}",
|
86
|
+
"UNKNOWN" => "\u{2753}"
|
87
|
+
}
|
88
|
+
symbol_text = (message == "") ? "" : severity_symbols[severity]
|
89
|
+
"\t\t\t\t#{symbol_text} #{severity_text}#{message}\n"
|
89
90
|
end
|
90
91
|
end
|
91
92
|
|
@@ -220,8 +220,13 @@ 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
|
+
severity_symbols = { "DEBUG" => "\u{1f527}", "INFO" => "\u{276f}",
|
225
|
+
"WARN" => "\u{2757}", "ERROR" => "\u{2b55}", "FATAL" => "\u{274c}",
|
226
|
+
"UNKNOWN" => "\u{2753}"
|
227
|
+
}
|
228
|
+
symbol_text = (message == "") ? "" : severity_symbols[severity]
|
229
|
+
"\t\t\t\t#{symbol_text} #{severity_text}#{message}\n"
|
225
230
|
end
|
226
231
|
|
227
232
|
# Load vars and environment
|
@@ -289,7 +294,6 @@ module Smartcloud
|
|
289
294
|
end
|
290
295
|
|
291
296
|
def self.start_app_rails(appname, container_path, container_path_with_version)
|
292
|
-
logger.info ""
|
293
297
|
logger.info "Ruby on Rails application detected."
|
294
298
|
|
295
299
|
# Setup rails env
|
@@ -338,14 +342,14 @@ module Smartcloud
|
|
338
342
|
system("docker network connect solr-network #{appname}_new")
|
339
343
|
system("docker network connect mysql-network #{appname}_new")
|
340
344
|
|
341
|
-
system("docker start --attach #{appname}_new")
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
345
|
+
if system("docker start --attach #{appname}_new")
|
346
|
+
# Runs only if #{appname}_new has been started successfully and is reachable.
|
347
|
+
self.hot_reloaded_app(appname)
|
348
|
+
self.clean_up(container_path)
|
349
|
+
else
|
350
|
+
# Runs only if #{appname}_new starting has failed.
|
351
|
+
self.stop_app("#{appname}_new")
|
352
|
+
end
|
349
353
|
end
|
350
354
|
end
|
351
355
|
|
@@ -366,7 +370,7 @@ module Smartcloud
|
|
366
370
|
end
|
367
371
|
|
368
372
|
# Hot reloading app containers and removing old app container
|
369
|
-
def self.
|
373
|
+
def self.hot_reloaded_app(appname)
|
370
374
|
logger.debug "Hot reloading '#{appname}' containers ..."
|
371
375
|
|
372
376
|
container_id = `docker ps -a -q --filter='name=^#{appname}$'`.chomp
|