smartcloud 0.0.185 → 0.0.186
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/smartcloud/grids/runner.rb +10 -5
- 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: a469e4892537372d8f5423b2c95adb391e3eb6fe42e0ea3fdf71c9afcfb6d786
|
4
|
+
data.tar.gz: 996c7d10ff86af7a76714cde12b0e2081fc88d97dfa108fb8929a08180daac89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a912c0ebde93d32e99f21c2f92543b791aa47c7b3d361221f1644a643133a72baf1c3269144c4e8f37042d59ccd4613cfd7e971fa78fa23676300cf4702c24b1
|
7
|
+
data.tar.gz: 50e228c0a1221a610b303459a6ff0c85afee88a9bb90e87c9ea214e8af2737f37b2a85e01a73b189560acac0976a5fb16e7d3ecfd97b40079f3bca156826cb16
|
@@ -308,6 +308,7 @@ module Smartcloud
|
|
308
308
|
# but the folder will have root user assigned instead of the current user.
|
309
309
|
FileUtils.mkdir_p("#{container_path}/app/vendor/bundle")
|
310
310
|
FileUtils.mkdir_p("#{container_path}/app/public")
|
311
|
+
FileUtils.mkdir_p("#{container_path}/app/node_modules")
|
311
312
|
|
312
313
|
# Setup Godfile
|
313
314
|
unless File.exist? "#{container_path_with_version}/Godfile"
|
@@ -333,6 +334,7 @@ module Smartcloud
|
|
333
334
|
--volume='#{container_path_with_version}:/app' \
|
334
335
|
--volume='#{container_path}/app/vendor/bundle:/app/vendor/bundle' \
|
335
336
|
--volume='#{container_path}/app/public:/app/public' \
|
337
|
+
--volume='#{container_path}/app/node_modules:/app/node_modules' \
|
336
338
|
--workdir='/app' \
|
337
339
|
--restart='always' \
|
338
340
|
--network='nginx-network' \
|
@@ -342,11 +344,11 @@ module Smartcloud
|
|
342
344
|
system("docker network connect mysql-network #{appname}_new")
|
343
345
|
|
344
346
|
if system("docker start --attach #{appname}_new")
|
345
|
-
|
346
|
-
|
347
|
-
|
347
|
+
if self.hot_reloaded_app?(appname)
|
348
|
+
self.clean_up(container_path)
|
349
|
+
exit 0
|
350
|
+
end
|
348
351
|
else
|
349
|
-
# Runs only if #{appname}_new starting has failed.
|
350
352
|
self.stop_app("#{appname}_new")
|
351
353
|
end
|
352
354
|
end
|
@@ -369,7 +371,7 @@ module Smartcloud
|
|
369
371
|
end
|
370
372
|
|
371
373
|
# Hot reloading app containers and removing old app container
|
372
|
-
def self.hot_reloaded_app(appname)
|
374
|
+
def self.hot_reloaded_app?(appname)
|
373
375
|
logger.debug "Hot reloading '#{appname}' containers ..."
|
374
376
|
|
375
377
|
container_id = `docker ps -a -q --filter='name=^#{appname}$'`.chomp
|
@@ -379,13 +381,16 @@ module Smartcloud
|
|
379
381
|
if system("docker container rename #{appname}_new #{appname}", [:out, :err] => File::NULL)
|
380
382
|
logger.debug "Container renamed from #{appname}_new #{appname}"
|
381
383
|
self.stop_app("#{appname}_old")
|
384
|
+
return true
|
382
385
|
end
|
383
386
|
end
|
384
387
|
else
|
385
388
|
if system("docker container rename #{appname}_new #{appname}", [:out, :err] => File::NULL)
|
386
389
|
logger.debug "Container renamed from #{appname}_new #{appname}"
|
390
|
+
return true
|
387
391
|
end
|
388
392
|
end
|
393
|
+
return false
|
389
394
|
end
|
390
395
|
|
391
396
|
def self.load_container_env_vars(container_path)
|