-
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-10-29T16-01-48Z"
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 "63ca362b94d230b0c1397700a133b8667efb3355f8684d080fb941d79e1647f6"
else
url "https://dl.min.io/server/minio/release/darwin-amd64/archive/minio.#{version}"
sha256 "58d171c7de2c9127b6f9f2ef924dca3cdce6ba57df15e0dd7b50da2677e3cc56"
end
elsif OS.linux?
if Hardware::CPU.arm?
url "https://dl.min.io/server/minio/release/linux-arm64/archive/minio.#{version}"
sha256 "2458a9291be68a874400d1e1c0725eccc24fd55c8123b32c0416b09daa52210c"
else
url "https://dl.min.io/server/minio/release/linux-amd64/archive/minio.#{version}"
sha256 "b9513f863a6ec6141065c7357284973ee1cb54b16310c168371460297e82c448"
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