mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
docs/Makefile: simplify and document make docs-debug
after ce4cc4cbb2
- Document `make docs-debug` command at https://docs.victoriametrics.com/#documentation - Remove unneeded ROOTDIR, REPODIR and WORKDIR env vars from docs/Makefile , since it is documented and expected that all the Makefile commands are run from the repository root. - Use `docker --rm` for running Docker container with local docs server, so it is automatically removed after pressing `Ctrl+C`. This makes the container cleanup automatic. Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6677
This commit is contained in:
parent
a135a4dcfa
commit
f320efd5ad
1 changed files with 9 additions and 14 deletions
|
@ -1,7 +1,3 @@
|
|||
ROOTDIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
REPODIR := $(ROOTDIR)/..
|
||||
WORKDIR := $(REPODIR)/..
|
||||
|
||||
# These commands must be run from the VictoriaMetrics repository root
|
||||
|
||||
# Converts images at docs folder to webp format
|
||||
|
@ -20,19 +16,18 @@ docs-images-to-webp-by-extension:
|
|||
find docs/ -type f ! -path 'docs/operator/*' ! -path 'docs/_site/*' -name '*.$(IMAGES_EXTENSION)' -print0 | xargs -0 rm -f
|
||||
|
||||
docs-debug:
|
||||
if [ ! -d $(WORKDIR)/vmdocs ]; then \
|
||||
git clone git@github.com:VictoriaMetrics/vmdocs $(WORKDIR)/vmdocs; \
|
||||
if [ ! -d vmdocs ]; then \
|
||||
git clone --depth 1 git@github.com:VictoriaMetrics/vmdocs vmdocs; \
|
||||
fi; \
|
||||
cd $(WORKDIR)/vmdocs && \
|
||||
cd vmdocs && \
|
||||
git checkout main && \
|
||||
git pull origin main && \
|
||||
cd $(REPODIR) && \
|
||||
cd .. && \
|
||||
docker build \
|
||||
-t vmdocs \
|
||||
$(WORKDIR)/vmdocs && \
|
||||
docker rm -f vmdocs || true && \
|
||||
-t vmdocs-docker-package \
|
||||
vmdocs && \
|
||||
docker run \
|
||||
-d \
|
||||
--name vmdocs \
|
||||
--rm \
|
||||
--name vmdocs-docker-container \
|
||||
-p 1313:1313 \
|
||||
-v ./docs:/opt/docs/content vmdocs
|
||||
-v ./docs:/opt/docs/content vmdocs-docker-package
|
||||
|
|
Loading…
Reference in a new issue