smartcloud 0.0.185 → 0.0.186

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
  SHA256:
3
- metadata.gz: c484a6fcf7dcb984273371aa62fdd8276a1ac34f8198e7bd14b54e6ca3c6f7a2
4
- data.tar.gz: f003009d8c5849c28540a4c7e807540015afdda3996d59464cf075be16c67f1a
3
+ metadata.gz: a469e4892537372d8f5423b2c95adb391e3eb6fe42e0ea3fdf71c9afcfb6d786
4
+ data.tar.gz: 996c7d10ff86af7a76714cde12b0e2081fc88d97dfa108fb8929a08180daac89
5
5
  SHA512:
6
- metadata.gz: f84e907973d6c90a7a8b72ff84c7b21d92ff9a1e57d8b63947ad26490473c6f506caad65fa83dad6a9f750f7e8c6da154dcd93da2d28748c081ec6e8b01f5483
7
- data.tar.gz: e35384f303b0d2b381371c412672686ff1ba8c199fad3097063694b90e6ce3ff3b41351a09da38a0d10acf38c5b7a2a62785701ab87acc6d62fc4c280ac02151
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
- # Runs only if #{appname}_new has been started successfully and is reachable.
346
- self.hot_reloaded_app(appname)
347
- self.clean_up(container_path)
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.185
4
+ version: 0.0.186
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timeboard