Skip to content

Commit

Permalink
Update make docs procedure (#6912)
Browse files Browse the repository at this point in the history
Co-authored-by: grafanabot <[email protected]>
  • Loading branch information
github-actions[bot] and grafanabot authored May 16, 2024
1 parent 5115340 commit fd55599
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
26 changes: 18 additions & 8 deletions docs/docs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ ifeq ($(origin HUGO_REFLINKSERRORLEVEL), undefined)
export HUGO_REFLINKSERRORLEVEL := WARNING
endif

# Whether to pull the latest container image before running the container.
ifeq ($(origin PULL), undefined)
export PULL := true
endif

.PHONY: docs-rm
docs-rm: ## Remove the docs container.
$(PODMAN) rm -f $(DOCS_CONTAINER)
Expand All @@ -81,13 +86,12 @@ make-docs:
fi

.PHONY: docs
docs: ## Serve documentation locally, which includes pulling the latest `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image. See also `docs-no-pull`.
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`.
ifeq ($(PULL), true)
docs: docs-pull make-docs
$(CURDIR)/make-docs $(PROJECTS)

.PHONY: docs-no-pull
docs-no-pull: ## Serve documentation locally without pulling the `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image.
docs-no-pull: make-docs
else
docs: make-docs
endif
$(CURDIR)/make-docs $(PROJECTS)

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

.PHONY: doc-validator
doc-validator: ## Run doc-validator on the entire docs folder.
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`.
doc-validator: make-docs
ifeq ($(PULL), true)
$(PODMAN) pull -q $(DOC_VALIDATOR_IMAGE)
endif
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(CURDIR)/make-docs $(PROJECTS)

.PHONY: vale
vale: ## Run vale on the entire docs folder.
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`.
vale: make-docs
ifeq ($(PULL), true)
$(PODMAN) pull -q $(VALE_IMAGE)
endif
DOCS_IMAGE=$(VALE_IMAGE) $(CURDIR)/make-docs $(PROJECTS)

.PHONY: update
Expand Down
14 changes: 12 additions & 2 deletions docs/make-docs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
# [Semantic versioning](https://semver.org/) is used to help the reader identify the significance of changes.
# Changes are relevant to this script and the support docs.mk GNU Make interface.
#
# ## 7.0.0 (2024-05-03)
#
# ### Changed
#
# - Pull images for all recipes that use containers by default.
#
# Use the `PULL=false` variable to disable this behavior.
#
# ### Removed
#
# - The `docs-no-pull` target as it's redundant with the new `PULL=false` variable.
#
# ## 6.1.0 (2024-04-22)
#
# ### Changed
Expand All @@ -14,8 +26,6 @@
#
# https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label
#
# ## 6.1.0 (2024-04-22)
#
# ### Added
#
# - Pseudo project for including only website resources and no website content.
Expand Down

0 comments on commit fd55599

Please sign in to comment.