Skip to content

Commit 90828e7

Browse files
committed
Update make docs procedure
1 parent 10beaa2 commit 90828e7

File tree

2 files changed

+268
-112
lines changed

2 files changed

+268
-112
lines changed

docs/docs.mk

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ endif
3434
# First project is considered the primary one used for doc-validator.
3535
PRIMARY_PROJECT := $(subst /,-,$(firstword $(subst :, ,$(firstword $(PROJECTS)))))
3636

37-
# Name for the container.
38-
ifeq ($(origin DOCS_CONTAINER), undefined)
39-
export DOCS_CONTAINER := $(PRIMARY_PROJECT)-docs
40-
endif
41-
4237
# Host port to publish container port to.
4338
ifeq ($(origin DOCS_HOST_PORT), undefined)
4439
export DOCS_HOST_PORT := 3002
@@ -80,35 +75,35 @@ docs-pull: ## Pull documentation base image.
8075

8176
make-docs: ## Fetch the latest make-docs script.
8277
make-docs:
83-
if [[ ! -f "$(PWD)/make-docs" ]]; then
78+
if [[ ! -f "$(CURDIR)/make-docs" ]]; then
8479
echo 'WARN: No make-docs script found in the working directory. Run `make update` to download it.' >&2
8580
exit 1
8681
fi
8782

8883
.PHONY: docs
8984
docs: ## Serve documentation locally, which includes pulling the latest `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image. See also `docs-no-pull`.
9085
docs: docs-pull make-docs
91-
$(PWD)/make-docs $(PROJECTS)
86+
$(CURDIR)/make-docs $(PROJECTS)
9287

9388
.PHONY: docs-no-pull
9489
docs-no-pull: ## Serve documentation locally without pulling the `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image.
9590
docs-no-pull: make-docs
96-
$(PWD)/make-docs $(PROJECTS)
91+
$(CURDIR)/make-docs $(PROJECTS)
9792

9893
.PHONY: docs-debug
9994
docs-debug: ## Run Hugo web server with debugging enabled. TODO: support all SERVER_FLAGS defined in website Makefile.
10095
docs-debug: make-docs
101-
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(PWD)/make-docs $(PROJECTS)
96+
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(CURDIR)/make-docs $(PROJECTS)
10297

10398
.PHONY: doc-validator
10499
doc-validator: ## Run doc-validator on the entire docs folder.
105100
doc-validator: make-docs
106-
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(PWD)/make-docs $(PROJECTS)
101+
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(CURDIR)/make-docs $(PROJECTS)
107102

108103
.PHONY: vale
109104
vale: ## Run vale on the entire docs folder.
110105
vale: make-docs
111-
DOCS_IMAGE=$(VALE_IMAGE) $(PWD)/make-docs $(PROJECTS)
106+
DOCS_IMAGE=$(VALE_IMAGE) $(CURDIR)/make-docs $(PROJECTS)
112107

113108
.PHONY: update
114109
update: ## Fetch the latest version of this Makefile and the `make-docs` script from Writers' Toolkit.

0 commit comments

Comments
 (0)