smartcloud 0.0.159 → 0.0.160

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: ce5d7b91f0eb81108aaacbf375fffb6529dbd0700872448ffb004ed7162ad956
4
- data.tar.gz: 734757bc7a2c00e31700b6ff39e149091c2d260c4e24e9a88cf6b35f40e37a5e
3
+ metadata.gz: 36546de54fc5de33c76c936ebdd3fca6f404d5b50654891b9efbdecfd2a27111
4
+ data.tar.gz: cd9c5d5e1d60dd5ba7ac1f1375a4b9b8bf86e2dc673df71e376b539954a9adb4
5
5
  SHA512:
6
- metadata.gz: a63b89d7d92a3c2dc3d4b02726ecdfcfad428e41ed950fa30290a2d93b2ddb8cc15db56237bbb4c53d3d72a29fb31fd05206575ee2fd48782ca5371655cafbd5
7
- data.tar.gz: bd70cafda75cc529cd86a6daa58b1b3223672ac63973c79ccb37b92f2f3d524e2a97fbc2c0a75bea5c7ef1670a0f58485112c3089578e5435750abd66f722184
6
+ metadata.gz: 032c7f76d57f6e1d0a83c550fff318abdecde15fa43dbdc361d661edd0b1c6292f5d66f86c968bde41a941c7ca0f9b3913e2e3b192c00dd00c5c9525991165b0
7
+ data.tar.gz: 68ea9ee8c1062f5622e65687c6188339eaccd453abd4e990a9e76f49d76abc781cf17cf8c2c33afa3237691c8333e38f580fa5b6b0ccb5e248b58e1bb64f9d8a
data/bin/buildpacker ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'smartcloud'
4
+
5
+ if ARGV[0] == 'start'
6
+ buildpacker = Smartcloud::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
 
@@ -0,0 +1,28 @@
1
+ module Smartcloud
2
+ class Buildpacker < Smartcloud::Base
3
+ def initialize
4
+ end
5
+
6
+ def pack
7
+ pack_rails if File.exist? "bin/rails"
8
+ logger.info "Could not continue ... Launch Failed."
9
+ end
10
+
11
+ def pack_rails
12
+ # Remove server.pid if it exists
13
+ FileUtils.rm("tmp/pids/server.pid") if File.exist? "tmp/pids/server.pid"
14
+
15
+ logger.info "Performing bundle install ..."
16
+ if system("bundle install --deployment --clean")
17
+ logger.info "Installing Javascript Dependencies & Pre-compiling Assets ..."
18
+ if system("bundle exec rails assets:precompile", out: File::NULL)
19
+ logger.debug "Starting Server ..."
20
+ if system("god -c Godfile -D")
21
+ logger.info "Launched Application ... Success."
22
+ end
23
+ # exit 0
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -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
 
@@ -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
 
@@ -275,10 +275,6 @@ module Smartcloud
275
275
  end
276
276
  container_path_with_version = "#{container_path}/releases/#{app_version}"
277
277
 
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
278
  # Launching Application
283
279
  logger.info "Launching Application ..."
284
280
  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
 
@@ -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.159
4
+ version: 0.0.160
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timeboard
@@ -17,22 +17,24 @@ 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
32
+ - lib/smartcloud/buildpacker.rb
30
33
  - lib/smartcloud/docker.rb
31
34
  - lib/smartcloud/grids/grid-mysql/docker-entrypoint-initdb.d/.keep
32
35
  - lib/smartcloud/grids/grid-nginx/fastcgi.conf
33
36
  - lib/smartcloud/grids/grid-nginx/nginx.tmpl
34
37
  - lib/smartcloud/grids/grid-runner/Dockerfile
35
- - lib/smartcloud/grids/grid-runner/buildpacks/buildpacker.rb
36
38
  - lib/smartcloud/grids/grid-runner/buildpacks/rails/Dockerfile
37
39
  - lib/smartcloud/grids/grid-runner/fcgiwrap/APKBUILD
38
40
  - lib/smartcloud/grids/grid-runner/fcgiwrap/fcgiwrap.confd
@@ -1,47 +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
- class << base
30
- def logger
31
- @logger ||= self.configure_logger_for(self.name)
32
- end
33
-
34
- def configure_logger_for(classname)
35
- logger = ::Logger.new($stdout)
36
- logger.level = ::Logger::DEBUG
37
- logger.formatter = proc do |severity, datetime, progname, message|
38
- "\t\t\t-----> #{severity}: #{message}\n"
39
- end
40
- logger.progname = classname
41
- logger
42
- end
43
- end
44
- end
45
-
46
- buildpacker = Buildpacker.new
47
- buildpacker.pack