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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aae853a3494b49392b961a51d7f138b51a2ea6e894ce6c14aaa0ab8b7f082363
|
4
|
+
data.tar.gz: 3a032296579e08171d80d83153d10d15e9ee45c7cb2aa81a1e21708a4daa76fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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}"
|
data/lib/smartcloud/logger.rb
CHANGED
@@ -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
|
28
|
+
logger.level = "::Logger::#{Smartcloud.config.logger_level}".to_sym
|
28
29
|
logger.progname = classname
|
29
30
|
logger
|
30
31
|
end
|