1
0
mirror of https://github.com/minio/docs.git synced 2025-07-30 07:03:26 +03:00

cleanup makefile and avoid github API requests (#554)

This commit is contained in:
Harshavardhana
2022-09-12 15:47:47 -07:00
committed by GitHub
parent 6423ebbd73
commit 2dc868af74
3 changed files with 51 additions and 22 deletions

View File

@ -8,7 +8,6 @@ SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
GITDIR = $(shell git rev-parse --abbrev-ref HEAD)
DEB = $(curl https://min.io/assets/downloads-minio.json | jq '.Linux."MinIO Server".amd64.DEB.download')
# Put it first so that "make" without argument is like "make help".
help:
@ -97,9 +96,7 @@ endif
sync-operator-version:
@echo "Retrieving latest Operator version"
$(shell wget -O /tmp/downloads-operator.json https://api.github.com/repos/minio/operator/releases/latest)
$(eval OPERATOR = $(shell cat /tmp/downloads-operator.json | jq '.tag_name[1:]'))
@$(eval OPERATOR = $(shell curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/minio/operator/releases/latest | sed "s/https:\/\/github.com\/minio\/operator\/releases\/tag\///"))
@$(eval kname = $(shell uname -s))
@echo "Updating Operator to ${OPERATOR}"
@ -118,7 +115,6 @@ sync-operator-version:
sync-kes-version:
@echo "Retrieving latest stable KES version"
@$(eval KES = $(shell curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/minio/kes/releases/latest | sed "s/https:\/\/github.com\/minio\/kes\/releases\/tag\///"))
@$(eval kname = $(shell uname -s))
@case "${kname}" in \
@ -132,9 +128,8 @@ sync-kes-version:
sync-minio-version:
@echo "Retrieving current MinIO version"
$(shell wget -O /tmp/downloads-minio.json https://min.io/assets/downloads-minio.json)
$(eval DEB = $(shell cat /tmp/downloads-minio.json | jq '.Linux."MinIO Server".amd64.DEB.download' | sed "s|linux-amd64|linux-amd64/archive|g"))
$(eval RPM = $(shell cat /tmp/downloads-minio.json | jq '.Linux."MinIO Server".amd64.RPM.download' | sed "s|linux-amd64|linux-amd64/archive|g"))
$(eval DEB = $(shell curl -s https://min.io/assets/downloads-minio.json | jq '.Linux."MinIO Server".amd64.DEB.download' | sed "s|linux-amd64|linux-amd64/archive|g"))
$(eval RPM = $(shell curl -s https://min.io/assets/downloads-minio.json | jq '.Linux."MinIO Server".amd64.RPM.download' | sed "s|linux-amd64|linux-amd64/archive|g"))
$(eval MINIO = $(shell 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\///"))
@$(eval kname = $(shell uname -s))
@ -155,7 +150,7 @@ sync-minio-version:
sync-cpp-docs:
# C++ repo does not have any releases yet.
@echo "Retrieving C++ docs from github.com/minio/minio-js"
@$(eval CPPLATEST = $(shell wget -q https://api.github.com/repos/minio/minio-cpp/releases/latest -O - | jq -r '.tag_name'))
@$(eval CPPLATEST = $(shell curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/minio/minio-cpp/releases/latest | sed "s/https:\/\/github.com\/minio\/minio-cpp\/releases\/tag\///"))
@echo "Latest stable is ${CPPLATEST}"
$(shell wget -q -O source/developers/cpp/API.md https://raw.githubusercontent.com/minio/minio-cpp/${CPPLATEST}/docs/API.md)
$(shell wget -q -O source/developers/cpp/quickstart.md https://raw.githubusercontent.com/minio/minio-cpp/${CPPLATEST}/README.md)
@ -173,7 +168,7 @@ sync-cpp-docs:
sync-dotnet-docs:
@echo "Retrieving .NET docs from github.com/minio/minio-dotnet"
@$(eval DOTNETLATEST = $(shell wget -q https://api.github.com/repos/minio/minio-dotnet/releases/latest -O - | jq -r '.tag_name'))
@$(eval DOTNETLATEST = $(shell curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/minio/minio-dotnet/releases/latest | sed "s/https:\/\/github.com\/minio\/minio-dotnet\/releases\/tag\///"))
@echo "Latest stable is ${DOTNETLATEST}"
$(shell wget -q -O source/developers/dotnet/API.md https://raw.githubusercontent.com/minio/minio-dotnet/${DOTNETLATEST}/Docs/API.md)
# $(shell wget -q -O source/developers/dotnet/quickstart.md https://raw.githubusercontent.com/minio/minio-dotnet/${DOTNETLATEST}/README.md)
@ -191,7 +186,7 @@ sync-dotnet-docs:
sync-go-docs:
@echo "Retrieving Go docs from github.com/minio/minio-go"
@$(eval GOLATEST = $(shell wget -q https://api.github.com/repos/minio/minio-go/releases/latest -O - | jq -r '.tag_name'))
@$(eval GOLATEST = $(shell curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/minio/minio-go/releases/latest | sed "s/https:\/\/github.com\/minio\/minio-go\/releases\/tag\///"))
@echo "Latest stable is ${GOLATEST}"
$(shell wget -q -O source/developers/go/API.md https://raw.githubusercontent.com/minio/minio-go/${GOLATEST}/docs/API.md)
$(shell wget -q -O source/developers/go/quickstart.md https://raw.githubusercontent.com/minio/minio-go/${GOLATEST}/README.md)
@ -209,7 +204,7 @@ sync-go-docs:
sync-haskell-docs:
@echo "Retrieving Haskell docs from github.com/minio/minio-hs"
@$(eval HASKELLLATEST = $(shell wget -q https://api.github.com/repos/minio/minio-hs/releases/latest -O - | jq -r '.tag_name'))
@$(eval HASKELLLATEST = $(shell curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/minio/minio-hs/releases/latest | sed "s/https:\/\/github.com\/minio\/minio-hs\/releases\/tag\///"))
@echo "Latest stable is ${HASKELLLATEST}"
$(shell wget -q -O source/developers/haskell/API.md https://raw.githubusercontent.com/minio/minio-hs/${HASKELLLATEST}/docs/API.md)
$(shell wget -q -O source/developers/haskell/quickstart.md https://raw.githubusercontent.com/minio/minio-hs/${HASKELLLATEST}/README.md)
@ -227,7 +222,7 @@ sync-haskell-docs:
sync-java-docs:
@echo "Retrieving Java docs from github.com/minio/minio-java"
@$(eval JAVALATEST = $(shell wget -q https://api.github.com/repos/minio/minio-java/releases/latest -O - | jq -r '.tag_name'))
@$(eval JAVALATEST = $(shell curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/minio/minio-java/releases/latest | sed "s/https:\/\/github.com\/minio\/minio-java\/releases\/tag\///"))
@echo "Latest stable is ${JAVALATEST}"
$(shell wget -q -O source/developers/java/API.md https://raw.githubusercontent.com/minio/minio-java/${JAVALATEST}/docs/API.md)
$(shell wget -q -O source/developers/java/quickstart.md https://raw.githubusercontent.com/minio/minio-java/${JAVALATEST}/README.md)
@ -248,7 +243,7 @@ sync-java-docs:
sync-javascript-docs:
@echo "Retrieving JavaScript docs from github.com/minio/minio-js"
@$(eval JAVASCRIPTLATEST = $(shell wget -q https://api.github.com/repos/minio/minio-js/releases/latest -O - | jq -r '.tag_name'))
@$(eval JAVASCRIPTLATEST = $(shell curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/minio/minio-js/releases/latest | sed "s/https:\/\/github.com\/minio\/minio-js\/releases\/tag\///"))
@echo "Latest stable is ${JAVASCRIPTLATEST}"
$(shell wget -q -O source/developers/javascript/API.md https://raw.githubusercontent.com/minio/minio-js/${JAVASCRIPTLATEST}/docs/API.md)
$(shell wget -q -O source/developers/javascript/quickstart.md https://raw.githubusercontent.com/minio/minio-js/${JAVASCRIPTLATEST}/README.md)
@ -266,7 +261,7 @@ sync-javascript-docs:
sync-python-docs:
@echo "Retrieving Python docs from github.com/minio/minio-py"
@$(eval PYTHONLATEST = $(shell wget -q https://api.github.com/repos/minio/minio-py/releases/latest -O - | jq -r '.tag_name'))
@$(eval PYTHONLATEST = $(shell curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/minio/minio-py/releases/latest | sed "s/https:\/\/github.com\/minio\/minio-py\/releases\/tag\///"))
@echo "Latest stable is ${PYTHONLATEST}"
$(shell wget -q -O source/developers/python/API.md https://raw.githubusercontent.com/minio/minio-py/${PYTHONLATEST}/docs/API.md)
$(shell wget -q -O source/developers/python/quickstart.md https://raw.githubusercontent.com/minio/minio-py/${PYTHONLATEST}/README.md)
@ -285,7 +280,7 @@ sync-python-docs:
sync-rust-docs:
# Rust repo does not have any releases yet.
@echo "Retrieving Rust docs from github.com/minio/minio-js"
@$(eval RUSTLATEST = $(shell wget -q https://api.github.com/repos/minio/minio-rs/releases/latest -O - | jq -r '.tag_name'))
@$(eval RUSTLATEST = $(shell curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/minio/minio-rust/releases/latest | sed "s/https:\/\/github.com\/minio\/minio-rust\/releases\/tag\///"))
@echo "Latest stable is ${RUSTLATEST}"
# $(shell wget -q -O source/developers/rust/API.md https://raw.githubusercontent.com/minio/minio-rs/${RUSTLATEST}/docs/API.md)
$(shell wget -q -O source/developers/rust/quickstart.md https://raw.githubusercontent.com/minio/minio-rs/${RUSTLATEST}/README.md)

34
build-docs.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
branch=$(git branch --show-current)
make clean-all
make k8s
make linux
make container
make windows
make macos
sudo mkdir -p /var/www/docs/minio/windows
sudo mkdir -p /var/www/docs/minio/macos
sudo rm -rf /var/www/docs/minio/kubernetes/upstream
sudo mkdir -p /var/www/docs/minio/kubernetes/upstream
sudo cp -vr build/${branch}/k8s/html/* /var/www/docs/minio/kubernetes/upstream/
sudo rm -rf /var/ww/docs/minio/container
sudo mkdir -p /var/www/docs/minio/container
sudo cp -vr build/${branch}/container/html/* /var/www/docs/minio/container/
sudo rm -rf /var/www/docs/minio/linux
sudo mkdir -p /var/www/docs/minio/linux
sudo cp -vr build/${branch}/linux/html/* /var/www/docs/minio/linux/
sudo rm -rf /var/www/docs/minio/macos
sudo mkdir -p /var/www/docs/minio/macos
sudo cp -vr build/${branch}/macos/html/* /var/www/docs/minio/macos/
sudo rm -rf /var/www/docs/minio/windows
sudo mkdir -p /var/www/docs/minio/windows
sudo cp -vr build/${branch}/windows/html/* /var/www/docs/minio/windows/

View File

@ -1,31 +1,31 @@
<div class="content__nav">
<div class="container">
<nav class="content__nav__inner">
<a target="_blank" rel="noreferrer" href="http://borkserv.ddns.net:9000/staging/docs-ia/k8s/html/index.html" class="{{ 'active' if doc_platform == 'kubernetes' }}">
<a target="_blank" rel="noreferrer" href="/docs/minio/kubernetes/upstream/index.html" class="{{ 'active' if doc_platform == 'kubernetes' }}">
<img class="hidden-rm" src="{{ pathto('_static/img/icons/kubernetes.svg',1) }}" alt="Kubernetes" />
<img class="hidden-rm" src="{{ pathto('_static/img/icons/kubernetes-inactive.svg',1) }}" alt="Kubernetes" />
Kubernetes
</a>
<a target="_blank" rel="noreferrer" href="http://borkserv.ddns.net:9000/staging/docs-ia/container/html/index.html" class="{{ 'active' if doc_platform == 'container' }}">
<a target="_blank" rel="noreferrer" href="/docs/minio/container/index.html" class="{{ 'active' if doc_platform == 'container' }}">
<img class="hidden-rm" src="{{ pathto('_static/img/icons/docker.svg',1) }}" alt="Docker" />
<img class="hidden-rm" src="{{ pathto('_static/img/icons/docker-inactive.svg',1) }}" alt="Docker" />
Docker
</a>
<a target="_blank" rel="noreferrer" href="http://borkserv.ddns.net:9000/staging/docs-ia/linux/html/index.html" class="{{ 'active' if doc_platform == 'linux' }}">
<a target="_blank" rel="noreferrer" href="/docs/minio/linux/index.html" class="{{ 'active' if doc_platform == 'linux' }}">
<img class="hidden-rm" src="{{ pathto('_static/img/icons/linux.svg',1) }}" alt="Linux" />
<img class="hidden-rm" src="{{ pathto('_static/img/icons/linux-inactive.svg',1) }}" alt="Linux" />
Linux
</a>
<a target="_blank" rel="noreferrer" href="http://borkserv.ddns.net:9000/staging/docs-ia/macos/html/index.html" class="{{ 'active' if doc_platform == 'macos' }}">
<a target="_blank" rel="noreferrer" href="/docs/minio/macos/index.html" class="{{ 'active' if doc_platform == 'macos' }}">
<img class="hidden-rm" src="{{ pathto('_static/img/icons/macos.svg',1) }}" alt="macOS" />
<img class="hidden-rm" src="{{ pathto('_static/img/icons/macos-inactive.svg',1) }}" alt="macOS" />
macOS
</a>
<a target="_blank" rel="noreferrer" href="http://borkserv.ddns.net:9000/staging/docs-ia/windows/html/index.html" class="{{ 'active' if doc_platform == 'windows' }}">
<a target="_blank" rel="noreferrer" href="/docs/minio/windows/index.html" class="{{ 'active' if doc_platform == 'windows' }}">
<img class="hidden-rm" src="{{ pathto('_static/img/icons/windows.svg',1) }}" alt="Windows" />
<img class="hidden-rm" src="{{ pathto('_static/img/icons/windows-inactive.svg',1) }}" alt="Windows" />
Windows