2024-01-26 20:01:40 +00:00
|
|
|
# These commands must be run from the VictoriaMetrics repository root
|
|
|
|
|
2023-11-22 16:22:41 +00:00
|
|
|
# Converts images at docs folder to webp format
|
2024-04-18 01:11:03 +00:00
|
|
|
# See https://docs.victoriametrics.com/single-server-victoriametrics/#images-in-documentation
|
2023-11-20 03:28:47 +00:00
|
|
|
docs-images-to-webp:
|
2023-11-22 16:22:41 +00:00
|
|
|
IMAGES_EXTENSION=jpg $(MAKE) docs-images-to-webp-by-extension
|
|
|
|
IMAGES_EXTENSION=jpeg $(MAKE) docs-images-to-webp-by-extension
|
|
|
|
IMAGES_EXTENSION=png $(MAKE) docs-images-to-webp-by-extension
|
2023-11-20 03:28:47 +00:00
|
|
|
|
2023-11-22 16:22:41 +00:00
|
|
|
docs-images-to-webp-by-extension:
|
|
|
|
docker run --rm -it \
|
|
|
|
-v $(shell pwd)/docs:/docs \
|
|
|
|
elswork/cwebp \
|
|
|
|
sh -c 'find /docs/ -type f ! -path "/docs/operator/*" ! -path "/docs/_site/*" -name "*.$(IMAGES_EXTENSION)" -print0 | \
|
|
|
|
xargs -0 -P $(MAKE_CONCURRENCY) -I {} sh -c '"'"'cwebp -preset drawing -m 6 -o "$${1%.*}.webp" $$1'"'"' _ {}'
|
|
|
|
find docs/ -type f ! -path 'docs/operator/*' ! -path 'docs/_site/*' -name '*.$(IMAGES_EXTENSION)' -print0 | xargs -0 rm -f
|
2024-07-24 08:00:31 +00:00
|
|
|
|
|
|
|
docs-debug:
|
2024-07-25 11:12:01 +00:00
|
|
|
if [ ! -d vmdocs ]; then \
|
|
|
|
git clone --depth 1 git@github.com:VictoriaMetrics/vmdocs vmdocs; \
|
2024-07-24 08:00:31 +00:00
|
|
|
fi; \
|
2024-07-25 11:12:01 +00:00
|
|
|
cd vmdocs && \
|
2024-07-24 08:00:31 +00:00
|
|
|
git checkout main && \
|
|
|
|
git pull origin main && \
|
2024-07-25 11:12:01 +00:00
|
|
|
cd .. && \
|
2024-07-24 08:00:31 +00:00
|
|
|
docker build \
|
2024-07-25 11:12:01 +00:00
|
|
|
-t vmdocs-docker-package \
|
|
|
|
vmdocs && \
|
2024-07-24 08:00:31 +00:00
|
|
|
docker run \
|
2024-07-25 11:12:01 +00:00
|
|
|
--rm \
|
|
|
|
--name vmdocs-docker-container \
|
2024-07-24 08:00:31 +00:00
|
|
|
-p 1313:1313 \
|
2024-07-25 11:12:01 +00:00
|
|
|
-v ./docs:/opt/docs/content vmdocs-docker-package
|