2024-01-26 21:01:40 +01:00
|
|
|
# These commands must be run from the VictoriaMetrics repository root
|
|
|
|
|
2023-11-22 17:22:41 +01:00
|
|
|
# Converts images at docs folder to webp format
|
2024-04-18 03:11:03 +02:00
|
|
|
# See https://docs.victoriametrics.com/single-server-victoriametrics/#images-in-documentation
|
2024-08-19 14:38:56 +02:00
|
|
|
docs-image:
|
2024-07-25 13:12:01 +02:00
|
|
|
if [ ! -d vmdocs ]; then \
|
|
|
|
git clone --depth 1 git@github.com:VictoriaMetrics/vmdocs vmdocs; \
|
2024-07-24 10:00:31 +02:00
|
|
|
fi; \
|
2024-07-25 13:12:01 +02:00
|
|
|
cd vmdocs && \
|
2024-07-24 10:00:31 +02:00
|
|
|
git checkout main && \
|
|
|
|
git pull origin main && \
|
2024-07-25 13:12:01 +02:00
|
|
|
cd .. && \
|
2024-07-24 10:00:31 +02:00
|
|
|
docker build \
|
2024-07-25 13:12:01 +02:00
|
|
|
-t vmdocs-docker-package \
|
2024-08-19 14:38:56 +02:00
|
|
|
vmdocs
|
|
|
|
|
|
|
|
docs-debug: docs docs-image
|
2024-07-24 10:00:31 +02:00
|
|
|
docker run \
|
2024-07-25 13:12:01 +02:00
|
|
|
--rm \
|
|
|
|
--name vmdocs-docker-container \
|
2024-07-24 10:00:31 +02:00
|
|
|
-p 1313:1313 \
|
2024-07-25 13:12:01 +02:00
|
|
|
-v ./docs:/opt/docs/content vmdocs-docker-package
|
2024-08-19 14:38:56 +02:00
|
|
|
|
2024-11-08 16:35:08 +01:00
|
|
|
docs-update-version: docs-image
|
|
|
|
$(if $(filter v%,$(PKG_TAG)), \
|
|
|
|
docker run \
|
|
|
|
--rm \
|
|
|
|
--entrypoint /usr/bin/find \
|
|
|
|
--name vmdocs-docker-container \
|
|
|
|
-v ./docs:/opt/docs/content vmdocs-docker-package \
|
|
|
|
content \
|
|
|
|
-regex ".*\.md" \
|
|
|
|
-exec sed -i 's/{{% available_from "#" %}}/{{% available_from "$(PKG_TAG)" %}}/g' {} \;, \
|
|
|
|
$(info "Skipping docs version update, invalid $$PKG_TAG: $(PKG_TAG)"))
|
|
|
|
|
2024-08-19 14:38:56 +02:00
|
|
|
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 {}' {} \;
|