smartcloud 0.0.146 → 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: 6976286ad263b1b4e34428658b5b89fb4a38e7626672527b0b9237efe7ff77da
4
- data.tar.gz: 800708d9594798102789a7a5ddbd9a10d7618acc391a545062f8840fee234b29
3
+ metadata.gz: ab4d783600234f10dae6ca73b7b8a3cf217f917788f49b848c6b3f77f76d6c93
4
+ data.tar.gz: c5e3358e29d21a0ba107065a8a1371dd9d58f8ff03ea9c41b5e4840bfe4e8820
5
5
  SHA512:
6
- metadata.gz: 837d477bc2afa431067cde5064aeae08f9a827f2e004ffa818d046bf23ede97f0d303eef1d2f38025a9df1dfb2bc32e89a4a7a07790fd5e490e745546c2208ca
7
- data.tar.gz: '092d20c4cf41bc1693fd96054ded4708b65cd5f5d49aaff213e626bdba410b115fb2a4ddaef05ea25d2a44b7142e4acdae6a792c2061ac496c74efb418b3d89a'
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,12 +1,7 @@
1
1
  # The main Smartcloud Grids Git driver
2
2
  module Smartcloud
3
3
  module Grids
4
- class Runner
5
- logger = Logger.new($stdout)
6
- logger.level = Logger::INFO
7
- logger.formatter = proc do |severity, datetime, progname, message|
8
- " #{severity}: #{message}\n"
9
- end
4
+ class Runner < Smartcloud::Base
10
5
 
11
6
  def initialize
12
7
  end
@@ -224,6 +219,10 @@ module Smartcloud
224
219
  end
225
220
 
226
221
  def self.prereceive_app(appname, username, oldrev, newrev, refname)
222
+ logger.formatter = proc do |severity, datetime, progname, message|
223
+ "\t\t\t#{severity}: #{message}\n"
224
+ end
225
+
227
226
  container_path = "#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-runner/apps/containers/#{appname}"
228
227
 
229
228
  ## Verify the user and ensure the user is correct and has access to this repository
@@ -287,6 +286,8 @@ module Smartcloud
287
286
  exit 1
288
287
  end
289
288
  end
289
+
290
+ logger.formatter = nil
290
291
  end
291
292
 
292
293
  def self.start_app(appname, app_version = 0)
@@ -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.146
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