-
Notifications
You must be signed in to change notification settings - Fork 19
/
minio.rb
90 lines (83 loc) · 3.11 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.2024-12-18T13-15-44Z"
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.min.io/server/minio/release/darwin-arm64/archive/minio.#{version}"
sha256 "af079f5c4e2cb855f8dd0c86eea57d1412c81c458bd7fcb8421bec34a4143fef"
else
url "https://dl.min.io/server/minio/release/darwin-amd64/archive/minio.#{version}"
sha256 "6262efafdde3c61387245385da58a9c314aa582effdc75f39099b847ea2caca0"
end
elsif OS.linux?
if Hardware::CPU.arm?
url "https://dl.min.io/server/minio/release/linux-arm64/archive/minio.#{version}"
sha256 "455c9b3093b7c1e6153c85cfd745c7c401a92497346ba24dbe45775c7b3ab1cd"
else
url "https://dl.min.io/server/minio/release/linux-amd64/archive/minio.#{version}"
sha256 "88182336ab5793488f2caad54846056b330f0dcb5c488b60d52434beeebae3ca"
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