smartcloud 0.0.142 → 0.0.147

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: d1680a39421448be0e5064d10b8056bcf2ad1553d811745e8eeaaa869bc69310
4
- data.tar.gz: ec341c0b5a3859cc06ebfbf752375b520b13e5bbba878b12203d10a2e09ea691
3
+ metadata.gz: ab4d783600234f10dae6ca73b7b8a3cf217f917788f49b848c6b3f77f76d6c93
4
+ data.tar.gz: c5e3358e29d21a0ba107065a8a1371dd9d58f8ff03ea9c41b5e4840bfe4e8820
5
5
  SHA512:
6
- metadata.gz: cac79cf4bb0e4cca3a97fce98e1925397f5e16cd04ba1ed7a06c982ca141b024301c5c83d6c42d2ec16dd5d0c356d0f59731d733c575ed8ab816ee73922c2472
7
- data.tar.gz: 793a1f5358a1b068e0b6326dea8846e1fe5510771d48e50928c9f9dd037bba382a5530303a3e3edf33b12b2cb05c1c2301fa9d9b883f19ec1db9fd115c18bd8d
6
+ metadata.gz: 461c82b342a2cd25038626c2e4757d4d9f0ca3ec5ac4624f3614d2fa8c379dd99ccdcb8d83d22c1aef6f75de820f095143d647becf79800425923d4651b049a0
7
+ data.tar.gz: 6f76f795e36f91f2f4e629815c73ccb2862365570dcc9b8eeb52c366a50c197b95a5da2d7be5cabf3d12d2466d07f6d2a2424f282a40105af503fb59dcd124a0
@@ -1,5 +1,4 @@
1
1
  require "ostruct"
2
- require "logger"
3
2
 
4
3
  # The main Smartcloud driver
5
4
  module Smartcloud
@@ -14,4 +13,5 @@ if File.exist?("#{Smartcloud.config.user_home_path}/.smartcloud/config/environme
14
13
  require "#{Smartcloud.config.user_home_path}/.smartcloud/config/environment"
15
14
  end
16
15
 
16
+ require 'smartcloud/base'
17
17
  require 'smartcloud/boot'
@@ -0,0 +1,10 @@
1
+ require 'smartcloud/logger'
2
+
3
+ module Smartcloud
4
+ class Base
5
+ include Smartcloud::Logger
6
+
7
+ def initialize
8
+ end
9
+ end
10
+ end
@@ -1,7 +1,8 @@
1
1
  # The main Smartcloud Grids Git driver
2
2
  module Smartcloud
3
3
  module Grids
4
- class Runner
4
+ class Runner < Smartcloud::Base
5
+
5
6
  def initialize
6
7
  end
7
8
 
@@ -115,7 +116,7 @@ module Smartcloud
115
116
  --build-arg DOCKER_GID=`getent group docker | cut -d: -f3` \
116
117
  --build-arg USER_UID=`id -u` \
117
118
  --build-arg USER_NAME=`id -un` \
118
- #{Smartcloud.config.root_path}/lib/smartcloud/grids/grid-runner")
119
+ #{Smartcloud.config.root_path}/lib/smartcloud/grids/grid-runner", out: File::NULL)
119
120
  puts "done"
120
121
  end
121
122
  end
@@ -218,13 +219,8 @@ module Smartcloud
218
219
  end
219
220
 
220
221
  def self.prereceive_app(appname, username, oldrev, newrev, refname)
221
- $stdout.sync = true
222
- logger = Logger.new($stdout)
223
-
224
- 5.times do
225
- puts '.'
226
- $stdout.flush
227
- sleep(1)
222
+ logger.formatter = proc do |severity, datetime, progname, message|
223
+ "\t\t\t#{severity}: #{message}\n"
228
224
  end
229
225
 
230
226
  container_path = "#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-runner/apps/containers/#{appname}"
@@ -290,6 +286,8 @@ module Smartcloud
290
286
  exit 1
291
287
  end
292
288
  end
289
+
290
+ logger.formatter = nil
293
291
  end
294
292
 
295
293
  def self.start_app(appname, app_version = 0)
@@ -354,7 +352,7 @@ module Smartcloud
354
352
  system("grep -q '^RAILS_SERVE_STATIC_FILES=' #{env_path} || echo 'RAILS_SERVE_STATIC_FILES=enabled' >> #{env_path}")
355
353
  system("grep -q '^LANG=' #{env_path} || echo 'LANG=en_US.UTF-8' >> #{env_path}")
356
354
  system("grep -q '^RAILS_MASTER_KEY=' #{env_path} || echo 'RAILS_MASTER_KEY=yourmasterkey' >> #{env_path}")
357
- puts "-----> WARNING: Please set your RAILS_MASTER_KEY env var for this rails app." if system("grep -q '^RAILS_MASTER_KEY=yourmasterkey' #{env_path}")
355
+ logger.warn "-----> WARNING: Please set your RAILS_MASTER_KEY env var for this rails app." if system("grep -q '^RAILS_MASTER_KEY=yourmasterkey' #{env_path}")
358
356
 
359
357
  # Setup gems folder. If this is not created then docker will create it while running the container,
360
358
  # but the folder will have root user assigned instead of the current user.
@@ -389,7 +387,7 @@ module Smartcloud
389
387
  system("docker network connect solr-network #{appname}")
390
388
  system("docker network connect mysql-network #{appname}")
391
389
 
392
- # system("docker start --attach #{appname}")
390
+ system("docker start --attach #{appname}")
393
391
  end
394
392
  end
395
393
  end
@@ -0,0 +1,24 @@
1
+ require "logger"
2
+
3
+ module Smartcloud
4
+ module Logger
5
+ def logger
6
+ @logger ||= Smartcloud::Logger.logger_for(self.class.name)
7
+ end
8
+
9
+ # Use a hash class-ivar to cache a unique Logger per class:
10
+ @loggers = {}
11
+
12
+ class << self
13
+ def logger_for(classname)
14
+ @loggers[classname] ||= configure_logger_for(classname)
15
+ end
16
+
17
+ def configure_logger_for(classname)
18
+ logger = Logger.new($stdout)
19
+ logger.progname = classname
20
+ logger
21
+ end
22
+ end
23
+ end
24
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.142
4
+ version: 0.0.147
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timeboard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-02 00:00:00.000000000 Z
11
+ date: 2019-09-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Smartcloud is a full-stack deployment framework for rails optimized for
14
14
  programmer happiness and peaceful administration. It encourages natural simplicity
@@ -25,6 +25,7 @@ files:
25
25
  - bin/runner
26
26
  - bin/smartcloud
27
27
  - lib/smartcloud.rb
28
+ - lib/smartcloud/base.rb
28
29
  - lib/smartcloud/boot.rb
29
30
  - lib/smartcloud/docker.rb
30
31
  - lib/smartcloud/grids/grid-mysql/docker-entrypoint-initdb.d/.keep
@@ -48,6 +49,7 @@ files:
48
49
  - lib/smartcloud/grids/nginx.rb
49
50
  - lib/smartcloud/grids/runner.rb
50
51
  - lib/smartcloud/grids/solr.rb
52
+ - lib/smartcloud/logger.rb
51
53
  - lib/smartcloud/machine.rb
52
54
  - lib/smartcloud/templates/dotsmartcloud/config/environment.rb
53
55
  - lib/smartcloud/templates/dotsmartcloud/grids/grid-mysql/data/.keep