smartcloud 0.0.162 → 0.0.167

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: baf79aac78353757357ec423418b2d68cd71e48dcdc5adc3c403f20a5c67a393
4
- data.tar.gz: 2d7f15ae683490d9a4f59b0d80e7c99398493e25e0ecdd3859c93cb7fbdf27a7
3
+ metadata.gz: aae853a3494b49392b961a51d7f138b51a2ea6e894ce6c14aaa0ab8b7f082363
4
+ data.tar.gz: 3a032296579e08171d80d83153d10d15e9ee45c7cb2aa81a1e21708a4daa76fb
5
5
  SHA512:
6
- metadata.gz: 66ef4183459fce92ebafe55776f065e15dd4d0d56b772a0b80bc1ba59d5f4f7e31f0ec38b7c4ebb1238424ae2cbd46d871d38de912fd6f11f0faab30d4cd49b9
7
- data.tar.gz: f67226982bcf81d4437701b5d96fc6d6ea769d8dd08799fa4364a71a442353fb73d1f87053c7a54a21c69db869a09cb5ec915c37646226a5762e8924328725cd
6
+ metadata.gz: 6022c7273b4da3e351a69a209fe4bdc7a373779caa8a91d0bca32728b1207833bdc90d91549e5733b15a88c467677128afbffdc1c8d4f8b69b5f1c22bed7599d
7
+ data.tar.gz: 9894db67787f37ce347269d748563e9b156945e397861eacaf7bc349bde82e8f721717f7ced8159fd8f2c411d5650f24a3ea4844d5955bfbc00923f532e99e4a
@@ -1,3 +1,5 @@
1
+ require 'open3'
2
+
1
3
  module Smartcloud
2
4
  module Grids
3
5
  class Buildpacker < Smartcloud::Base
@@ -5,25 +7,46 @@ module Smartcloud
5
7
  end
6
8
 
7
9
  def pack
10
+ logger.formatter = proc do |severity, datetime, progname, message|
11
+ "\t\t\t--------> #{severity}: #{message}\n"
12
+ end
13
+
8
14
  pack_rails if File.exist? "bin/rails"
9
15
  logger.info "Could not continue ... Launch Failed."
16
+
17
+ logger.formatter = nil
10
18
  end
11
19
 
12
20
  def pack_rails
13
21
  # Remove server.pid if it exists
14
22
  FileUtils.rm("tmp/pids/server.pid") if File.exist? "tmp/pids/server.pid"
15
23
 
24
+ # Perform bundle install
16
25
  logger.info "Performing bundle install ..."
17
- if system("bundle install --deployment --clean")
18
- logger.info "Installing Javascript Dependencies & Pre-compiling Assets ..."
19
- if system("bundle exec rails assets:precompile", out: File::NULL)
20
- logger.debug "Starting Server ..."
21
- if system("god -c Godfile -D")
22
- logger.info "Launched Application ... Success."
23
- end
24
- # exit 0
26
+ logger.formatter = proc do |severity, datetime, progname, message|
27
+ "\t\t\t\t#{message}"
28
+ end
29
+ Open3.popen2("bundle", "install", "--deployment", "--clean") do |stdin, stdout_andstderr, wait_thr|
30
+ stdout_andstderr.each do |line|
31
+ logger.info "#{line}"
25
32
  end
33
+ exit_status = wait_thr.value
34
+ end
35
+
36
+ if exit_status.success?
37
+ logger.error "Could not complete bundle install."
26
38
  end
39
+
40
+ # if system("bundle install --deployment --clean")
41
+ # logger.info "Installing Javascript Dependencies & Pre-compiling Assets ..."
42
+ # if system("bundle exec rails assets:precompile", out: File::NULL)
43
+ # logger.debug "Starting Server ..."
44
+ # if system("god -c Godfile -D")
45
+ # logger.info "Launched Application ... Success."
46
+ # end
47
+ # # exit 0
48
+ # end
49
+ # end
27
50
  end
28
51
  end
29
52
  end
@@ -222,7 +222,6 @@ module Smartcloud
222
222
  logger.formatter = proc do |severity, datetime, progname, message|
223
223
  "\t\t\t-----> #{severity}: #{message}\n"
224
224
  end
225
- logger.level = ::Logger::DEBUG
226
225
 
227
226
  # Load vars and environment
228
227
  container_path = "#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-runner/apps/containers/#{appname}"
@@ -23,8 +23,9 @@ module Smartcloud
23
23
  end
24
24
 
25
25
  def configure_logger_for(classname)
26
+ $stdout.sync = true
26
27
  logger = ::Logger.new($stdout)
27
- logger.level = ::Logger::INFO
28
+ logger.level = "::Logger::#{Smartcloud.config.logger_level}".to_sym
28
29
  logger.progname = classname
29
30
  logger
30
31
  end
@@ -11,3 +11,7 @@ Smartcloud.config.sysadmin_email = "admin@yourdomain.com"
11
11
 
12
12
  # letsencrypt test boolean to be used
13
13
  Smartcloud.config.letsencrypt_test = false
14
+
15
+ # logger level
16
+ # DEBUG, INFO, WARN, ERROR, FATAL, UNKNOWN
17
+ Smartcloud.config.logger_level = "INFO"
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.162
4
+ version: 0.0.167
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timeboard