Skip to content

Commit 774085f

Browse files
Update make docs procedure (#3303)
Co-authored-by: grafanabot <[email protected]>
1 parent eb9dd3c commit 774085f

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

docs/docs.mk

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ ifeq ($(origin HUGO_REFLINKSERRORLEVEL), undefined)
6565
export HUGO_REFLINKSERRORLEVEL := WARNING
6666
endif
6767

68+
# Whether to pull the latest container image before running the container.
69+
ifeq ($(origin PULL), undefined)
70+
export PULL := true
71+
endif
72+
6873
.PHONY: docs-rm
6974
docs-rm: ## Remove the docs container.
7075
$(PODMAN) rm -f $(DOCS_CONTAINER)
@@ -81,13 +86,12 @@ make-docs:
8186
fi
8287

8388
.PHONY: docs
84-
docs: ## Serve documentation locally, which includes pulling the latest `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image. See also `docs-no-pull`.
89+
docs: ## Serve documentation locally, which includes pulling the latest `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image. To not pull the image, set `PULL=false`.
90+
ifeq ($(PULL), true)
8591
docs: docs-pull make-docs
86-
$(CURDIR)/make-docs $(PROJECTS)
87-
88-
.PHONY: docs-no-pull
89-
docs-no-pull: ## Serve documentation locally without pulling the `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image.
90-
docs-no-pull: make-docs
92+
else
93+
docs: make-docs
94+
endif
9195
$(CURDIR)/make-docs $(PROJECTS)
9296

9397
.PHONY: docs-debug
@@ -96,13 +100,19 @@ docs-debug: make-docs
96100
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(CURDIR)/make-docs $(PROJECTS)
97101

98102
.PHONY: doc-validator
99-
doc-validator: ## Run doc-validator on the entire docs folder.
103+
doc-validator: ## Run doc-validator on the entire docs folder which includes pulling the latest `DOC_VALIDATOR_IMAGE` (default: `grafana/doc-validator:latest`) container image. To not pull the image, set `PULL=false`.
100104
doc-validator: make-docs
105+
ifeq ($(PULL), true)
106+
$(PODMAN) pull -q $(DOC_VALIDATOR_IMAGE)
107+
endif
101108
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(CURDIR)/make-docs $(PROJECTS)
102109

103110
.PHONY: vale
104-
vale: ## Run vale on the entire docs folder.
111+
vale: ## Run vale on the entire docs folder which includes pulling the latest `VALE_IMAGE` (default: `grafana/vale:latest`) container image. To not pull the image, set `PULL=false`.
105112
vale: make-docs
113+
ifeq ($(PULL), true)
114+
$(PODMAN) pull -q $(VALE_IMAGE)
115+
endif
106116
DOCS_IMAGE=$(VALE_IMAGE) $(CURDIR)/make-docs $(PROJECTS)
107117

108118
.PHONY: update

docs/make-docs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
# [Semantic versioning](https://semver.org/) is used to help the reader identify the significance of changes.
77
# Changes are relevant to this script and the support docs.mk GNU Make interface.
88
#
9+
# ## 7.0.0 (2024-05-03)
10+
#
11+
# ### Changed
12+
#
13+
# - Pull images for all recipes that use containers by default.
14+
#
15+
# Use the `PULL=false` variable to disable this behavior.
16+
#
17+
# ### Removed
18+
#
19+
# - The `docs-no-pull` target as it's redundant with the new `PULL=false` variable.
20+
#
921
# ## 6.1.0 (2024-04-22)
1022
#
1123
# ### Changed
@@ -14,8 +26,6 @@
1426
#
1527
# https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label
1628
#
17-
# ## 6.1.0 (2024-04-22)
18-
#
1929
# ### Added
2030
#
2131
# - Pseudo project for including only website resources and no website content.

0 commit comments

Comments
 (0)