2021-03-12 21:53:17 +08:00
|
|
|
.PHONY: pull docs docs-quick docs-no-pull docs-test docs-local-static
|
2019-12-18 20:26:47 +08:00
|
|
|
|
2023-02-07 23:10:16 +08:00
|
|
|
PODMAN = $(shell if command -v podman >/dev/null 2>&1; then echo podman; else echo docker; fi)
|
2023-01-14 00:19:23 +08:00
|
|
|
IMAGE = grafana/docs-base:latest
|
2023-01-30 20:48:12 +08:00
|
|
|
CONTENT_PATH = /hugo/content/docs/grafana/latest
|
2021-01-21 20:27:54 +08:00
|
|
|
LOCAL_STATIC_PATH = ../../website/static
|
2021-02-05 01:54:48 +08:00
|
|
|
PORT = 3002:3002
|
2020-01-14 23:26:00 +08:00
|
|
|
|
2021-03-12 21:53:17 +08:00
|
|
|
pull:
|
2023-01-16 20:55:40 +08:00
|
|
|
$(PODMAN) pull $(IMAGE)
|
2021-03-12 21:53:17 +08:00
|
|
|
|
|
|
|
docs: pull
|
2023-02-22 18:54:35 +08:00
|
|
|
$(PODMAN) run --init -v $(shell pwd)/sources:$(CONTENT_PATH):Z -p $(PORT) --rm -it $(IMAGE) make server
|
2023-01-16 20:55:40 +08:00
|
|
|
|
|
|
|
docs-preview: pull
|
2023-02-22 18:54:35 +08:00
|
|
|
$(PODMAN) run --init -v $(shell pwd)/sources:$(CONTENT_PATH):Z -p $(PORT) --rm -it $(IMAGE) make server BUILD_DRAFTS=true
|
2023-01-16 20:55:40 +08:00
|
|
|
|
2020-10-30 17:22:01 +08:00
|
|
|
docs-no-pull:
|
2023-02-22 18:54:35 +08:00
|
|
|
$(PODMAN) run --init -v $(shell pwd)/sources:$(CONTENT_PATH):Z -p $(PORT) --rm -it $(IMAGE) make server
|
2020-10-22 15:57:56 +08:00
|
|
|
|
2021-03-12 21:53:17 +08:00
|
|
|
docs-test: pull
|
2023-02-22 18:54:35 +08:00
|
|
|
$(PODMAN) run --init -v $(shell pwd)/sources:$(CONTENT_PATH):Z --rm -it $(IMAGE) make prod
|
2021-01-21 20:27:54 +08:00
|
|
|
|
|
|
|
# expects that you have grafana/website checked out in same path as the grafana repo.
|
2021-03-12 21:53:17 +08:00
|
|
|
docs-local-static: pull
|
2021-01-21 20:27:54 +08:00
|
|
|
if [ ! -d "$(LOCAL_STATIC_PATH)" ]; then echo "local path (website project) $(LOCAL_STATIC_PATH) not found"]; exit 1; fi
|
2023-02-22 18:54:35 +08:00
|
|
|
$(PODMAN) run --init -v $(shell pwd)/sources:$(CONTENT_PATH):Z \
|
2021-02-05 01:54:48 +08:00
|
|
|
-v $(shell pwd)/$(LOCAL_STATIC_PATH):/hugo/static:Z -p $(PORT) --rm -it $(IMAGE)
|
2023-03-16 20:14:55 +08:00
|
|
|
|
|
|
|
.PHONY: doc-validator/%
|
|
|
|
doc-validator/%: ## Run doc-validator on a specific path. To lint the path /docs/sources/administration, run 'make doc-validator/administration'.
|
|
|
|
doc-validator/%:
|
|
|
|
$(PODMAN) run --init -v "$(shell pwd)/sources:/sources" grafana/doc-validator:latest --skip-image-validation --include=$(subst doc-validator/,,$@) ./sources /docs/grafana/latest
|