smartcloud 0.0.158 → 0.0.163
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/bin/buildpacker +8 -0
- data/lib/smartcloud/boot.rb +2 -1
- data/lib/smartcloud/docker.rb +1 -1
- data/lib/smartcloud/grids/buildpacker.rb +36 -0
- data/lib/smartcloud/grids/grid-buildpacker/.keep +0 -0
- data/lib/smartcloud/grids/grid-runner/buildpacks/rails/Dockerfile +4 -3
- data/lib/smartcloud/grids/mysql.rb +1 -1
- data/lib/smartcloud/grids/nginx.rb +1 -1
- data/lib/smartcloud/grids/runner.rb +0 -5
- data/lib/smartcloud/grids/solr.rb +1 -1
- data/lib/smartcloud/logger.rb +1 -0
- data/lib/smartcloud/machine.rb +1 -1
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-buildpacker/.keep +0 -0
- data/lib/smartcloud/user.rb +1 -1
- metadata +6 -2
- data/lib/smartcloud/grids/grid-runner/buildpacks/buildpacker.rb +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa235f54deb609fe88dec9acfbe702abaf5706fd96ff82190069290649421c0d
|
4
|
+
data.tar.gz: 1282d8a13e38329f6a0b997449b4717f1c96be57e6a500d6cd43f276552433cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f081a4ee22383b700e0452e77528c82aab9b341a0b37ac6a1786a0cfe1f1d735ce0bcccc4af62d84345da0d2962ff644c80a05aa31a62ab20015c9f3a184638e
|
7
|
+
data.tar.gz: d9e3780a456b5300522c4d6db7e6ab3875a454436ca69a2dde1769effa1563bbf4cd736e118ad833ec3c360b59808846ccab1ca9bdd6335b30805fe9b0c414dd
|
data/bin/buildpacker
ADDED
data/lib/smartcloud/boot.rb
CHANGED
@@ -3,7 +3,7 @@ require "tempfile"
|
|
3
3
|
|
4
4
|
# The main Smartcloud Boot driver
|
5
5
|
module Smartcloud
|
6
|
-
class Boot
|
6
|
+
class Boot < Smartcloud::Base
|
7
7
|
def initialize
|
8
8
|
end
|
9
9
|
|
@@ -87,6 +87,7 @@ require 'smartcloud/docker'
|
|
87
87
|
|
88
88
|
require 'smartcloud/grids/nginx'
|
89
89
|
require 'smartcloud/grids/runner'
|
90
|
+
require 'smartcloud/grids/buildpacker'
|
90
91
|
require 'smartcloud/grids/solr'
|
91
92
|
require 'smartcloud/grids/mysql'
|
92
93
|
|
data/lib/smartcloud/docker.rb
CHANGED
@@ -0,0 +1,36 @@
|
|
1
|
+
module Smartcloud
|
2
|
+
module Grids
|
3
|
+
class Buildpacker < Smartcloud::Base
|
4
|
+
def initialize
|
5
|
+
end
|
6
|
+
|
7
|
+
def pack
|
8
|
+
logger.formatter = proc do |severity, datetime, progname, message|
|
9
|
+
"\t\t\t-----> #{severity}: #{message}\n"
|
10
|
+
end
|
11
|
+
|
12
|
+
pack_rails if File.exist? "bin/rails"
|
13
|
+
logger.info "Could not continue ... Launch Failed."
|
14
|
+
|
15
|
+
logger.formatter = nil
|
16
|
+
end
|
17
|
+
|
18
|
+
def pack_rails
|
19
|
+
# Remove server.pid if it exists
|
20
|
+
FileUtils.rm("tmp/pids/server.pid") if File.exist? "tmp/pids/server.pid"
|
21
|
+
|
22
|
+
logger.info "Performing bundle install ..."
|
23
|
+
if system("bundle install --deployment --clean")
|
24
|
+
logger.info "Installing Javascript Dependencies & Pre-compiling Assets ..."
|
25
|
+
if system("bundle exec rails assets:precompile", out: File::NULL)
|
26
|
+
logger.debug "Starting Server ..."
|
27
|
+
if system("god -c Godfile -D")
|
28
|
+
logger.info "Launched Application ... Success."
|
29
|
+
end
|
30
|
+
# exit 0
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
File without changes
|
@@ -22,9 +22,10 @@ RUN apk add --update build-base && \
|
|
22
22
|
|
23
23
|
USER "$USER_NAME"
|
24
24
|
|
25
|
-
# Install
|
26
|
-
RUN gem install
|
25
|
+
# Install gems
|
26
|
+
RUN gem install smartcloud && \
|
27
|
+
gem install bundler && \
|
27
28
|
gem install god
|
28
29
|
|
29
30
|
# Command to execute at container start
|
30
|
-
CMD ["
|
31
|
+
CMD ["buildpacker", "start"]
|
@@ -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}"
|
@@ -275,10 +274,6 @@ module Smartcloud
|
|
275
274
|
end
|
276
275
|
container_path_with_version = "#{container_path}/releases/#{app_version}"
|
277
276
|
|
278
|
-
# Setup Buildpacker
|
279
|
-
buildpacker_path = "#{Smartcloud.config.root_path}/lib/smartcloud/grids/grid-runner/buildpacks/buildpacker.rb"
|
280
|
-
FileUtils.cp(buildpacker_path, container_path_with_version)
|
281
|
-
|
282
277
|
# Launching Application
|
283
278
|
logger.info "Launching Application ..."
|
284
279
|
if File.exist? "#{container_path_with_version}/bin/rails"
|
data/lib/smartcloud/logger.rb
CHANGED
data/lib/smartcloud/machine.rb
CHANGED
File without changes
|
data/lib/smartcloud/user.rb
CHANGED
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.
|
4
|
+
version: 0.0.163
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timeboard
|
@@ -17,22 +17,25 @@ email: hello@timeboard.me
|
|
17
17
|
executables:
|
18
18
|
- smartcloud
|
19
19
|
- runner
|
20
|
+
- buildpacker
|
20
21
|
extensions: []
|
21
22
|
extra_rdoc_files: []
|
22
23
|
files:
|
23
24
|
- MIT-LICENSE
|
24
25
|
- README.md
|
26
|
+
- bin/buildpacker
|
25
27
|
- bin/runner
|
26
28
|
- bin/smartcloud
|
27
29
|
- lib/smartcloud.rb
|
28
30
|
- lib/smartcloud/base.rb
|
29
31
|
- lib/smartcloud/boot.rb
|
30
32
|
- lib/smartcloud/docker.rb
|
33
|
+
- lib/smartcloud/grids/buildpacker.rb
|
34
|
+
- lib/smartcloud/grids/grid-buildpacker/.keep
|
31
35
|
- lib/smartcloud/grids/grid-mysql/docker-entrypoint-initdb.d/.keep
|
32
36
|
- lib/smartcloud/grids/grid-nginx/fastcgi.conf
|
33
37
|
- lib/smartcloud/grids/grid-nginx/nginx.tmpl
|
34
38
|
- lib/smartcloud/grids/grid-runner/Dockerfile
|
35
|
-
- lib/smartcloud/grids/grid-runner/buildpacks/buildpacker.rb
|
36
39
|
- lib/smartcloud/grids/grid-runner/buildpacks/rails/Dockerfile
|
37
40
|
- lib/smartcloud/grids/grid-runner/fcgiwrap/APKBUILD
|
38
41
|
- lib/smartcloud/grids/grid-runner/fcgiwrap/fcgiwrap.confd
|
@@ -52,6 +55,7 @@ files:
|
|
52
55
|
- lib/smartcloud/logger.rb
|
53
56
|
- lib/smartcloud/machine.rb
|
54
57
|
- lib/smartcloud/templates/dotsmartcloud/config/environment.rb
|
58
|
+
- lib/smartcloud/templates/dotsmartcloud/grids/grid-buildpacker/.keep
|
55
59
|
- lib/smartcloud/templates/dotsmartcloud/grids/grid-mysql/data/.keep
|
56
60
|
- lib/smartcloud/templates/dotsmartcloud/grids/grid-nginx/certificates/.keep
|
57
61
|
- lib/smartcloud/templates/dotsmartcloud/grids/grid-nginx/htpasswd/.keep
|
@@ -1,45 +0,0 @@
|
|
1
|
-
require "logger"
|
2
|
-
|
3
|
-
class Buildpacker
|
4
|
-
def initialize
|
5
|
-
end
|
6
|
-
|
7
|
-
def pack
|
8
|
-
pack_rails if File.exist? "bin/rails"
|
9
|
-
logger.info "Could not continue ... Launch Failed."
|
10
|
-
end
|
11
|
-
|
12
|
-
def pack_rails
|
13
|
-
# Remove server.pid if it exists
|
14
|
-
FileUtils.rm("tmp/pids/server.pid") if File.exist? "tmp/pids/server.pid"
|
15
|
-
|
16
|
-
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
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.logger
|
30
|
-
@logger ||= self.configure_logger_for(self.name)
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.configure_logger_for(classname)
|
34
|
-
logger = ::Logger.new($stdout)
|
35
|
-
logger.level = ::Logger::DEBUG
|
36
|
-
logger.formatter = proc do |severity, datetime, progname, message|
|
37
|
-
"\t\t\t-----> #{severity}: #{message}\n"
|
38
|
-
end
|
39
|
-
logger.progname = classname
|
40
|
-
logger
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
buildpacker = Buildpacker.new
|
45
|
-
buildpacker.pack
|