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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fff4e804fc58c90059552cb40f468f7965a59e7a2846eabf717055da100ae6fb
4
- data.tar.gz: c16f0c09b64dabbf9f9fd086b66eb029eec69c5cb4fb1640e0cbd6d0ccedb017
3
+ metadata.gz: aa235f54deb609fe88dec9acfbe702abaf5706fd96ff82190069290649421c0d
4
+ data.tar.gz: 1282d8a13e38329f6a0b997449b4717f1c96be57e6a500d6cd43f276552433cb
5
5
  SHA512:
6
- metadata.gz: 44f8f14e9cc581fb038c8d164cb07efdf0c893796df35f71133d62d54babde5023285fb66d143e45ccacd2864cbfe316f597570eefcd1a98405216701cf117d3
7
- data.tar.gz: 8a491b59078f8bf1a273dbde6b54d012cb8f95b9fc303ce617696098909951fdfcec02e797fe78cca041c84cb7acb9bbd3891f8d690ee2fa0e9e8c35e0f6008e
6
+ metadata.gz: f081a4ee22383b700e0452e77528c82aab9b341a0b37ac6a1786a0cfe1f1d735ce0bcccc4af62d84345da0d2962ff644c80a05aa31a62ab20015c9f3a184638e
7
+ data.tar.gz: d9e3780a456b5300522c4d6db7e6ab3875a454436ca69a2dde1769effa1563bbf4cd736e118ad833ec3c360b59808846ccab1ca9bdd6335b30805fe9b0c414dd
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'smartcloud'
4
+
5
+ if ARGV[0] == 'start'
6
+ buildpacker = Smartcloud::Grids::Buildpacker.new
7
+ buildpacker.pack
8
+ end
@@ -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
 
@@ -1,6 +1,6 @@
1
1
  # The main Smartcloud Docker driver
2
2
  module Smartcloud
3
- class Docker
3
+ class Docker < Smartcloud::Base
4
4
  def initialize
5
5
  end
6
6
 
@@ -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
@@ -22,9 +22,10 @@ RUN apk add --update build-base && \
22
22
 
23
23
  USER "$USER_NAME"
24
24
 
25
- # Install bundler and god gems
26
- RUN gem install bundler && \
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 ["ruby", "buildpacker.rb"]
31
+ CMD ["buildpacker", "start"]
@@ -1,7 +1,7 @@
1
1
  # The main Smartcloud Grids Mysql driver
2
2
  module Smartcloud
3
3
  module Grids
4
- class Mysql
4
+ class Mysql < Smartcloud::Base
5
5
  def initialize
6
6
  end
7
7
 
@@ -1,7 +1,7 @@
1
1
  # The main Smartcloud Grids Nginx driver
2
2
  module Smartcloud
3
3
  module Grids
4
- class Nginx
4
+ class Nginx < Smartcloud::Base
5
5
  def initialize
6
6
  end
7
7
 
@@ -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"
@@ -1,7 +1,7 @@
1
1
  # The main Smartcloud Grids Solr driver
2
2
  module Smartcloud
3
3
  module Grids
4
- class Solr
4
+ class Solr < Smartcloud::Base
5
5
  def initialize
6
6
  end
7
7
 
@@ -23,6 +23,7 @@ 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
28
  logger.level = ::Logger::INFO
28
29
  logger.progname = classname
@@ -1,6 +1,6 @@
1
1
  # The main Smartcloud Machine driver
2
2
  module Smartcloud
3
- class Machine
3
+ class Machine < Smartcloud::Base
4
4
  def initialize
5
5
  end
6
6
 
@@ -3,7 +3,7 @@ require "base64"
3
3
 
4
4
  # The main Smartcloud User driver
5
5
  module Smartcloud
6
- class User
6
+ class User < Smartcloud::Base
7
7
  def initialize
8
8
  end
9
9
 
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.158
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