-
Notifications
You must be signed in to change notification settings - Fork 373
Expand file tree
/
Copy pathsync-minio-version.sh
More file actions
executable file
·69 lines (52 loc) · 2.61 KB
/
sync-minio-version.sh
File metadata and controls
executable file
·69 lines (52 loc) · 2.61 KB
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
#!/bin/bash
set -e
function main() {
if test -f /tmp/downloads-minio.json; then
rm /tmp/downloads-minio.json
fi
curl --retry 10 -Ls https://min.io/assets/downloads-minio.json -o /tmp/downloads-minio.json
if test -f /tmp/downloads-minio.json; then
echo "Populated downloads-minio.json from latest, proceeding"
fi
# AMD64 arch
MINIOAMD64=$(cat /tmp/downloads-minio.json | jq '.Linux."MinIO Server".amd64.Binary.download')
DEB=$(cat /tmp/downloads-minio.json | jq '.Linux."MinIO Server".amd64.DEB.download')
RPM=$(cat /tmp/downloads-minio.json | jq '.Linux."MinIO Server".amd64.RPM.download')
# ARM64 arch
MINIOARM64=$(cat /tmp/downloads-minio.json | jq '.Linux."MinIO Server".arm64.Binary.download')
DEBARM64=$(cat /tmp/downloads-minio.json | jq '.Linux."MinIO Server".arm64.DEB.download')
RPMARM64=$(cat /tmp/downloads-minio.json | jq '.Linux."MinIO Server".arm64.RPM.download')
# ppc64le arch
MINIOPPC64LE=$(cat /tmp/downloads-minio.json | jq '.Linux."MinIO Server".ppc64le.Binary.download')
DEBPPC64LE=$(cat /tmp/downloads-minio.json | jq '.Linux."MinIO Server".ppc64le.DEB.download')
RPMPPC64LE=$(cat /tmp/downloads-minio.json | jq '.Linux."MinIO Server".ppc64le.RPM.download')
MINIO=$(curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/minio/minio/releases/latest | sed "s/https:\/\/github.com\/minio\/minio\/releases\/tag\///")
kname=$(uname -s)
case "${kname}" in \
"Darwin") \
sed -i "" "s|MINIOLATEST|${MINIO}|g" source/conf.py; \
sed -i "" "s|DEBURL|${DEB}|g" source/conf.py; \
sed -i "" "s|RPMURL|${RPM}|g" source/conf.py; \
sed -i "" "s|MINIOURL|${MINIOAMD64}|g" source/conf.py; \
sed -i "" "s|DEBARM64URL|${DEBARM64}|g" source/conf.py; \
sed -i "" "s|RPMARM64URL|${RPMARM64}|g" source/conf.py; \
sed -i "" "s|MINIOARM64URL|${MINIOARM64}|g" source/conf.py; \
sed -i "" "s|DEBPPC64LEURL|${DEBPPC64LE}|g" source/conf.py; \
sed -i "" "s|RPMPPC64LEURL|${RPMPPC64LE}|g" source/conf.py; \
sed -i "" "s|MINIOPPC64LEURL|${MINIOPPC64LE}|g" source/conf.py; \
;; \
*) \
sed -i "s|MINIOLATEST|${MINIO}|g" source/conf.py; \
sed -i "s|DEBURL|${DEB}|g" source/conf.py; \
sed -i "s|RPMURL|${RPM}|g" source/conf.py; \
sed -i "s|MINIOURL|${MINIOAMD64}|g" source/conf.py; \
sed -i "s|DEBARM64URL|${DEBARM64}|g" source/conf.py; \
sed -i "s|RPMARM64URL|${RPMARM64}|g" source/conf.py; \
sed -i "s|MINIOARM64URL|${MINIOARM64}|g" source/conf.py; \
sed -i "s|DEBPPC64LEURL|${DEBPPC64LE}|g" source/conf.py; \
sed -i "s|RPMPPC64LEURL|${RPMPPC64LE}|g" source/conf.py; \
sed -i "s|MINIOPPC64LEURL|${MINIOPPC64LE}|g" source/conf.py; \
;; \
esac
}
main