forked from minio/homebrew-stable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
minio.rb
90 lines (83 loc) · 3.12 KB
/
minio.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class Minio < Formula
# minio specific
git_tag = "RELEASE.2022-05-26T05-48-41Z"
desc "High Performance Object Storage compatible with Amazon S3 API"
homepage "https://min.io"
url "https://github.com/minio/minio"
version git_tag
revision 1
if OS.mac?
if Hardware::CPU.arm?
url "https://dl.minio.io/server/minio/release/darwin-arm64/archive/minio.#{version}"
sha256 "bf3ae398e0a5612ce4740f3db13e263754b1b15e4c7d965cb5dc2c85b5fc40aa"
else
url "https://dl.minio.io/server/minio/release/darwin-amd64/archive/minio.#{version}"
sha256 "c4d5a7db162fc8efb38198e6a24e23f0ceef058326fce6099184a3b7fc24f677"
end
elsif OS.linux?
if Hardware::CPU.arm?
url "https://dl.minio.io/server/minio/release/linux-arm64/archive/minio.#{version}"
sha256 "5ff8ba7713bce5e5dfde0dd97c36fa64ff3eb24de5b8dd80f4cab7e734f3ec49"
else
url "https://dl.minio.io/server/minio/release/linux-amd64/archive/minio.#{version}"
sha256 "b3f6467f7441ceb6741636356e6c0c6909dab7a1e4e36b7d8c795333be17564f"
end
end
def install
bin.install Dir.glob("minio.*").first => "minio"
end
def post_install
ohai "Download complete!"
ohai "Useful links:"
puts <<~EOS
Command-line Access: https://docs.min.io/docs/minio-client-quickstart-guide
Object API (Amazon S3 compatible):
Go: https://docs.min.io/docs/golang-client-quickstart-guide
Java: https://docs.min.io/docs/java-client-quickstart-guide
Python: https://docs.min.io/docs/python-client-quickstart-guide
JavaScript: https://docs.min.io/docs/javascript-client-quickstart-guide
.NET: https://docs.min.io/docs/dotnet-client-quickstart-guide
Talk to the community: https://slack.min.io
EOS
ohai "Get started:"
puts `#{bin}/minio server -h`
end
test do
(testpath/"config.json").write <<~EOS
{
"version": "14",
"credential": {
"accessKey": "minio",
"secretKey": "minio123"
},
"region": "us-east-1",
"browser": "on",
"logger": {
"console": {
"level": "error",
"enable": true
},
"file": {
"level": "error",
"enable": false,
"filename": ""
}
},
"notify": {
"redis": {
"1": {
"enable": true,
"address": "127.0.0.1:6379",
"password": "",
"key": "minio_events"
}
}
}
}
EOS
minio_io = IO.popen("#{bin}/minio --config-dir #{testpath} server #{testpath}/export", :err=>[:child, :out])
sleep 1
Process.kill("INT", minio_io.pid)
assert_match("connection refused", minio_io.read)
end
end