smartcloud 0.0.170 → 0.0.171

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: 24fd60fd7e8faf1b8fc21ed2d0258329b2963c4748a0b312c0272104045f422c
4
- data.tar.gz: 64a033c1adb9c5640bbc356d623b7e43d72d7d3508422f13479cddffeea5c24a
3
+ metadata.gz: e156f54f86c83734ce2a079df33131fbe931c06ba14cc40f546f02c0ed591099
4
+ data.tar.gz: 3fcf9d76b499c06cb4759c99fb057aa594795c08e6b147ed8a80d5d7edbb4936
5
5
  SHA512:
6
- metadata.gz: a9136551d60c79830bfd1d9d68175a4c8181accc516d64432108af898a8cddfe30f0d8c354e8575c31bff4fbfd1701afce161ba7585dec1d9368ef434419ebdd
7
- data.tar.gz: 3132e08e01400f5bd7da3ffd9231aa15db0f26dc36df8b06eb880ae983a5d284a589a29da43e94dc2eabf561aed258357e219c63a788ac326b88fad9a171ece0
6
+ metadata.gz: 89513317605a7d9fd69a11d563a82f87159e7d253a33f15f3941e3b7f6efd694e0e055e6679ad764c984c0acaab34134e8b86fc34ef4c7235765ed4e22be9e86
7
+ data.tar.gz: 6638d96afd7517fbb0f453f7578aa650406ed08096dfb9dc001189b9e89ee01ce715165635b7c635210eb3f4e1320642d0091207957160bb569f019253a6882b
@@ -7,48 +7,72 @@ module Smartcloud
7
7
  end
8
8
 
9
9
  def pack
10
- logger.formatter = proc do |severity, datetime, progname, message|
11
- "\t\t\t------> #{severity}: #{message}\n"
12
- end
10
+ set_logger_formatter_arrow
13
11
 
14
12
  pack_rails if File.exist? "bin/rails"
15
- logger.info "Could not continue ... Launch Failed."
16
13
 
14
+ logger.info "Could not continue ... Launch Failed."
17
15
  logger.formatter = nil
16
+ exit 1
18
17
  end
19
18
 
20
19
  def pack_rails
21
- # Remove server.pid if it exists
22
- FileUtils.rm("tmp/pids/server.pid") if File.exist? "tmp/pids/server.pid"
20
+ return unless bundle_install?
21
+ return unless precompile_assets?
22
+ return unless start_web_server?
23
+
24
+ exit 0
25
+ end
23
26
 
24
- # Perform bundle install
27
+ # Perform bundle install
28
+ def bundle_install?
25
29
  logger.info "Performing bundle install ..."
26
- logger.formatter = proc do |severity, datetime, progname, message|
27
- "\t\t\t\t#{message}"
30
+ set_logger_formatter_tabs
31
+ Open3.popen2("bundle", "install", "--deployment", "--clean") do |stdin, stdout_and_stderr, wait_thr|
32
+ stdout_and_stderr.each { |line| logger.info "#{line}" }
33
+ return true if wait_thr.value.success?
28
34
  end
29
- exit_status = nil
30
- Open3.popen2("bundle", "install", "--deployment", "--clean") do |stdin, stdout_andstderr, wait_thr|
31
- stdout_andstderr.each do |line|
32
- logger.info "#{line}"
33
- end
34
- exit_status = wait_thr.value
35
+ set_logger_formatter_arrow
36
+ logger.error "Could not complete bundle install. Please check if your Gemfile.lock is upto date."
37
+ return false
38
+ end
39
+
40
+ # Perform pre-compiling of assets
41
+ def precompile_assets?
42
+ logger.info "Installing Javascript dependencies & pre-compiling assets ..."
43
+ set_logger_formatter_tabs
44
+ Open3.popen2("bundle", "exec", "rails", "assets:precompile") do |stdin, stdout_and_stderr, wait_thr|
45
+ stdout_and_stderr.each { |line| logger.info "#{line}" }
46
+ return true if wait_thr.value.success?
35
47
  end
48
+ set_logger_formatter_arrow
49
+ logger.error "Could not install Javascript dependencies or pre-compile assets."
50
+ return false
51
+ end
52
+
53
+ # Perform starting of web server
54
+ def start_web_server?
55
+ logger.debug "Starting Web Server ..."
36
56
 
37
- if exit_status.success?
38
- logger.error "Could not complete bundle install."
39
- end
57
+ # Remove server.pid if it exists
58
+ FileUtils.rm("tmp/pids/server.pid") if File.exist? "tmp/pids/server.pid"
40
59
 
41
- # if system("bundle install --deployment --clean")
42
- # logger.info "Installing Javascript Dependencies & Pre-compiling Assets ..."
43
- # if system("bundle exec rails assets:precompile", out: File::NULL)
44
- # logger.debug "Starting Server ..."
45
- # if system("god -c Godfile -D")
46
- # logger.info "Launched Application ... Success."
47
- # end
48
- # # exit 0
49
- # end
60
+ # if system("god -c Godfile -D")
61
+ logger.info "Launched Application ... Success."
50
62
  # end
51
63
  end
64
+
65
+ def set_logger_formatter_arrow
66
+ logger.formatter = proc do |severity, datetime, progname, message|
67
+ "\t\t\t------> #{severity}: #{message}\n"
68
+ end
69
+ end
70
+
71
+ def set_logger_formatter_tabs
72
+ logger.formatter = proc do |severity, datetime, progname, message|
73
+ "\t\t\t\t#{message}"
74
+ end
75
+ end
52
76
  end
53
77
  end
54
78
  end
@@ -327,9 +327,9 @@ module Smartcloud
327
327
  --env-file='#{container_path}/env' \
328
328
  --expose='5000' \
329
329
  --volume='#{Smartcloud.config.user_home_path}/.smartcloud/config:#{Smartcloud.config.user_home_path}/.smartcloud/config' \
330
- --volume='#{container_path_with_version}:/code' \
331
- --volume='#{container_path}/gems:/code/vendor/bundle' \
332
- --workdir='/code' \
330
+ --volume='#{container_path_with_version}:/app' \
331
+ --volume='#{container_path}/gems:/app/vendor/bundle' \
332
+ --workdir='/app' \
333
333
  --restart='always' \
334
334
  --network='nginx-network' \
335
335
  smartcloud/buildpacks/rails", out: File::NULL)
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.170
4
+ version: 0.0.171
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timeboard