mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
71632bb4b6
Use same hugo docker image for webp conversion.
While there, remove unused *.png images.
(cherry picked from commit 36bc458e9e
)
32 lines
948 B
Makefile
32 lines
948 B
Makefile
# These commands must be run from the VictoriaMetrics repository root
|
|
|
|
# Converts images at docs folder to webp format
|
|
# See https://docs.victoriametrics.com/single-server-victoriametrics/#images-in-documentation
|
|
docs-image:
|
|
if [ ! -d vmdocs ]; then \
|
|
git clone --depth 1 git@github.com:VictoriaMetrics/vmdocs vmdocs; \
|
|
fi; \
|
|
cd vmdocs && \
|
|
git checkout main && \
|
|
git pull origin main && \
|
|
cd .. && \
|
|
docker build \
|
|
-t vmdocs-docker-package \
|
|
vmdocs
|
|
|
|
docs-debug: docs docs-image
|
|
docker run \
|
|
--rm \
|
|
--name vmdocs-docker-container \
|
|
-p 1313:1313 \
|
|
-v ./docs:/opt/docs/content vmdocs-docker-package
|
|
|
|
docs-images-to-webp: docs-image
|
|
docker run \
|
|
--rm \
|
|
--entrypoint /usr/bin/find \
|
|
--name vmdocs-docker-container \
|
|
-v ./docs:/opt/docs/content vmdocs-docker-package \
|
|
content \
|
|
-regex ".*\.\(png\|jpg\|jpeg\)" \
|
|
-exec sh -c 'cwebp -preset drawing -m 6 -o $$(echo {} | cut -f-1 -d.).webp {} && rm -rf {}' {} \;
|