smartcloud 0.3.2 → 0.4.1

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: 474fdd2356fd60ade2ebb2cad2982ebf66d2d045ae19559e13d7cc244b43657a
4
- data.tar.gz: 17f10d83a70e04d06ba32205bbe3878da6eec8b106898c385fdc36bf00b0e24a
3
+ metadata.gz: 771fafc023e8af4228d942f6629a05c1607f8b3bed34c79e79190083ce6b9d7b
4
+ data.tar.gz: a57da3cf4e496b8fea60db3bde5b2a2f2ae1e55f0862659ffaa3208310cb0ac1
5
5
  SHA512:
6
- metadata.gz: 2f27dfd480192c5eac77388da0c8e94487a7266b7b4596ad9b1883cf98a14932b8d4b096f9b10a7512788b002254231f7614099a61ced315075e360830f31dd3
7
- data.tar.gz: 612b0aa19cce9b011b720c994917b6977507ed6e46861d3a007c43247a4d922379b331453684bbd070dc41d753b051104073922395aa4ebb9205c5e9de6c11cd
6
+ metadata.gz: 0a7a46a96df2b9ffecb71f283d160bec26a7fef5153c90d6583310a3b73928e20776ebe45470604e531556d12f6416dc6532963cacb9a06e6acd0ae5cb7edcdf
7
+ data.tar.gz: 140f28602924a10a725612ea8011036dd3fca8b68a9860955492420e9461625883ccc255de0b174fc88f3b2e2847763ce210f0d6f0016b00d0e37ed5c63a9cba
@@ -63,8 +63,9 @@ module Smartcloud
63
63
  --network='nginx-network' \
64
64
  smartcloud/buildpacks/rails", out: File::NULL)
65
65
 
66
- system("docker network connect mysql-network #{new_container}")
67
66
  system("docker network connect elasticsearch-network #{new_container}")
67
+ system("docker network connect minio-network #{new_container}")
68
+ system("docker network connect mysql-network #{new_container}")
68
69
 
69
70
  if system("docker start --attach #{new_container}")
70
71
  logger.debug "Starting Web Server ..."
@@ -118,7 +119,7 @@ module Smartcloud
118
119
 
119
120
  # Fix for mysql2 gem to support sha256_password, until it is fixed in main mysql2 gem.
120
121
  # https://github.com/brianmario/mysql2/issues/1023
121
- exit_status = system("mkdir ./lib/mariadb && ln -s /usr/lib/mariadb/plugin ./lib/mariadb/plugin")
122
+ exit_status = system("mkdir -p ./lib/mariadb && ln -s /usr/lib/mariadb/plugin ./lib/mariadb/plugin")
122
123
 
123
124
  if exit_status
124
125
  return true
@@ -18,6 +18,7 @@ require 'smartcloud/buildpacker'
18
18
  require 'smartcloud/user'
19
19
 
20
20
  require 'smartcloud/grids/elasticsearch'
21
+ require 'smartcloud/grids/minio'
21
22
  require 'smartcloud/grids/mysql'
22
23
  require 'smartcloud/grids/nginx'
23
24
  require 'smartcloud/grids/prereceiver'
@@ -58,6 +58,11 @@ module Smartcloud
58
58
  username: #{SecureRandom.hex(8)}
59
59
  password: #{SecureRandom.hex(16)}
60
60
 
61
+ minio:
62
+ port: 9000
63
+ access_key: #{SecureRandom.hex(8)}
64
+ secret_key: #{SecureRandom.hex(16)}
65
+
61
66
  mysql:
62
67
  port: 3306
63
68
  root_password: #{SecureRandom.hex(16)}
File without changes
@@ -0,0 +1,64 @@
1
+ # The main Smartcloud Grids Minio driver
2
+ module Smartcloud
3
+ module Grids
4
+ class Minio < Smartcloud::Base
5
+ def initialize
6
+ end
7
+
8
+ def self.up(*args)
9
+ args.flatten!
10
+ exposed = args.empty? ? '' : args.shift
11
+
12
+ if Smartcloud::Docker.running?
13
+ # Creating networks
14
+ unless system("docker network inspect minio-network", [:out, :err] => File::NULL)
15
+ print "-----> Creating network minio-network ... "
16
+ if system("docker network create minio-network", out: File::NULL)
17
+ puts "done"
18
+ end
19
+ end
20
+
21
+ # Creating & Starting containers
22
+ print "-----> Creating container minio ... "
23
+ if system("docker create \
24
+ --name='minio' \
25
+ --env MINIO_ACCESS_KEY=#{Smartcloud.credentials.minio[:access_key]} \
26
+ --env MINIO_SECRET_KEY=#{Smartcloud.credentials.minio[:secret_key]} \
27
+ --user `id -u`:`id -g` \
28
+ #{"--publish='#{Smartcloud.credentials.minio[:port]}:#{Smartcloud.credentials.minio[:port]}'" if exposed == '--exposed'} \
29
+ --volume='#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-minio/data:/data' \
30
+ --restart='always' \
31
+ --network='minio-network' \
32
+ minio/minio:RELEASE.2020-02-27T00-23-05Z server /data", out: File::NULL)
33
+
34
+ puts "done"
35
+ print "-----> Starting container minio ... "
36
+ if system("docker start minio", out: File::NULL)
37
+ puts "done"
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ def self.down
44
+ if Smartcloud::Docker.running?
45
+ # Stopping & Removing containers - in reverse order
46
+ print "-----> Stopping container minio ... "
47
+ if system("docker stop 'minio'", out: File::NULL)
48
+ puts "done"
49
+ print "-----> Removing container minio ... "
50
+ if system("docker rm 'minio'", out: File::NULL)
51
+ puts "done"
52
+ end
53
+ end
54
+
55
+ # Removing networks
56
+ print "-----> Removing network minio-network ... "
57
+ if system("docker network rm minio-network", out: File::NULL)
58
+ puts "done"
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -185,6 +185,9 @@ module Smartcloud
185
185
  'grids/grid-elasticsearch/data/***',
186
186
  'grids/grid-elasticsearch/logs/***',
187
187
 
188
+ 'grids/grid-minio',
189
+ 'grids/grid-minio/data/***',
190
+
188
191
  'grids/grid-mysql',
189
192
  'grids/grid-mysql/data/***',
190
193
 
@@ -222,6 +225,10 @@ module Smartcloud
222
225
  'grids/grid-elasticsearch/logs',
223
226
  'grids/grid-elasticsearch/logs/.keep',
224
227
 
228
+ 'grids/grid-minio',
229
+ 'grids/grid-minio/data',
230
+ 'grids/grid-minio/data/.keep',
231
+
225
232
  'grids/grid-mysql',
226
233
  'grids/grid-mysql/data',
227
234
  'grids/grid-mysql/data/.keep',
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Smartcloud
4
- VERSION = "0.3.2".freeze
4
+ VERSION = "0.4.1".freeze
5
5
 
6
6
  def self.version
7
7
  @@version ||= VERSION
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.3.2
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timeboard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-01 00:00:00.000000000 Z
11
+ date: 2020-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -87,6 +87,7 @@ files:
87
87
  - lib/smartcloud/engine/buildpacks/rails/Dockerfile
88
88
  - lib/smartcloud/grids/elasticsearch.rb
89
89
  - lib/smartcloud/grids/grid-elasticsearch/.keep
90
+ - lib/smartcloud/grids/grid-minio/.keep
90
91
  - lib/smartcloud/grids/grid-mysql/docker-entrypoint-initdb.d/.keep
91
92
  - lib/smartcloud/grids/grid-nginx/.keep
92
93
  - lib/smartcloud/grids/grid-prereceiver/Dockerfile
@@ -262,6 +263,7 @@ files:
262
263
  - lib/smartcloud/grids/grid-solr/docker-entrypoint-initdb.d/.keep
263
264
  - lib/smartcloud/grids/grid-solr/sunspot/conf/schema.xml
264
265
  - lib/smartcloud/grids/grid-solr/sunspot/conf/solrconfig.xml
266
+ - lib/smartcloud/grids/minio.rb
265
267
  - lib/smartcloud/grids/mysql.rb
266
268
  - lib/smartcloud/grids/nginx.rb
267
269
  - lib/smartcloud/grids/prereceiver.rb
@@ -277,6 +279,7 @@ files:
277
279
  - lib/smartcloud/templates/dotsmartcloud/config/users.yml
278
280
  - lib/smartcloud/templates/dotsmartcloud/grids/grid-elasticsearch/data/.keep
279
281
  - lib/smartcloud/templates/dotsmartcloud/grids/grid-elasticsearch/logs/.keep
282
+ - lib/smartcloud/templates/dotsmartcloud/grids/grid-minio/data/.keep
280
283
  - lib/smartcloud/templates/dotsmartcloud/grids/grid-mysql/data/.keep
281
284
  - lib/smartcloud/templates/dotsmartcloud/grids/grid-nginx/certificates/.keep
282
285
  - lib/smartcloud/templates/dotsmartcloud/grids/grid-nginx/fastcgi.conf