Module: MinioRunner
- Defined in:
- lib/minio_runner/child_process.rb,
lib/minio_runner.rb,
lib/minio_runner/config.rb,
lib/minio_runner/system.rb,
lib/minio_runner/network.rb,
lib/minio_runner/version.rb,
lib/minio_runner/mc_binary.rb,
lib/minio_runner/mc_manager.rb,
lib/minio_runner/base_binary.rb,
lib/minio_runner/minio_binary.rb,
lib/minio_runner/binary_manager.rb,
lib/minio_runner/minio_health_check.rb,
lib/minio_runner/minio_server_manager.rb
Overview
Licensed to the Software Freedom Conservancy (SFC) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The SFC licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Defined Under Namespace
Classes: BaseBinary, BinaryManager, ChildProcess, Config, McBinary, McManager, MinioBinary, MinioHealthCheck, MinioServerManager, Network, System
Constant Summary
collapse
- VERSION =
"1.0.0"
- @@started =
false
Class Method Summary
collapse
Class Method Details
.config(&block) ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'lib/minio_runner.rb', line 18
def config(&block)
@config ||= MinioRunner::Config.new
if block_given?
yield @config
else
@config
end
end
|
.install_binaries ⇒ Object
.logger ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/minio_runner.rb', line 27
def logger
@logger ||=
Logger
.new(STDOUT)
.tap do |logger|
logger.level =
(
if System.env(:log_level)
Kernel.const_get("Logger::#{System.env(:log_level)}")
else
Logger::INFO
end
)
original_formatter = logger.formatter || Logger::Formatter.new
logger.formatter =
proc do |severity, time, progname, msg|
original_formatter.call(severity, time, progname, "[MinioRunner]: #{msg.strip}")
end
end
end
|
.remove_install_dir ⇒ Object
102
103
104
105
106
|
# File 'lib/minio_runner.rb', line 102
def remove_install_dir
logger.info("Removing MinioRunner install directory at #{MinioRunner.config.install_dir}...")
FileUtils.rm_rf(MinioRunner.config.install_dir) if Dir.exist?(MinioRunner.config.install_dir)
logger.info("Done removing MinioRunner install directory.")
end
|
.reset_config! ⇒ Object
98
99
100
|
# File 'lib/minio_runner.rb', line 98
def reset_config!
@config = nil
end
|
.start(install: true) ⇒ Object
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/minio_runner.rb', line 49
def start(install: true)
logger.debug("Starting minio_runner...")
install_binaries if install
start_server
setup_alias
setup_buckets
logger.debug("Started minio_runner.")
@@started = true
end
|
.started? ⇒ Boolean
62
63
64
|
# File 'lib/minio_runner.rb', line 62
def started?
@@started
end
|
.stop ⇒ Object
90
91
92
93
94
95
96
|
# File 'lib/minio_runner.rb', line 90
def stop
return if !started?
logger.debug("Stopping minio_runner...")
MinioRunner::MinioServerManager.stop
logger.debug("Stopped minio_runner.")
@@started = false
end
|