-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (48 loc) · 2.13 KB
/
Copy pathMakefile
File metadata and controls
58 lines (48 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# default target is build
.DEFAULT_GOAL := help
# if we are on GitHub Actions then use the "system" otherwise virtualenv
ifeq ($(GITHUB_ACTIONS), true)
VENV_DIR :=
PIP := pip
PYTHON := python
PROPERDOCS := properdocs
# throw away to ensure we always run this
ACTIVATE := .activate
else
VENV_DIR := .venv
PIP := $(VENV_DIR)/bin/pip
PYTHON := $(VENV_DIR)/bin/python
PROPERDOCS := $(VENV_DIR)/bin/properdocs
ACTIVATE := $(VENV_DIR)/bin/activate
endif
NEUTRON_SAMPLE_CONFIG := docs/design-guide/neutron-understack-config-sample.md
WFTMPLS := $(wildcard components/*-workflows/*/workflowtemplates/*.yaml)
.PHONY: help
help: ## Displays this help message
@echo "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/|/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s'|' | sort)"
$(ACTIVATE): requirements-docs.txt
@[ -n "${VENV_DIR}" -a ! -d "${VENV_DIR}" ] && python -m venv $(VENV_DIR) || :
@$(PIP) install -U -r requirements-docs.txt
@touch $(ACTIVATE)
.PHONY: wftmpls
wftmpls: $(WFTMPLS) $(ACTIVATE)
@mkdir -p docs/workflows
@rm -f docs/workflows/*.md
@$(PYTHON) scripts/argo-workflows-to-mkdocs.py components/global-workflows docs/workflows
@$(PYTHON) scripts/argo-workflows-to-mkdocs.py workflows docs/workflows
.PHONY: component-docs-check
component-docs-check: ## Validate component docs coverage for ArgoCD app templates
@$(PYTHON) scripts/check-component-docs.py
$(NEUTRON_SAMPLE_CONFIG): ## Generate neutron-understack sample configuration docs
@mkdir -p docs/design-guide
@uv sync --directory python/neutron-understack
@{ printf '# neutron-understack Sample Configuration\n\n```ini\n'; \
uv run --directory python/neutron-understack oslo-config-generator \
--config-file tools/config/neutron-understack-config-generator.conf; \
printf '\n```\n'; } > $(NEUTRON_SAMPLE_CONFIG)
.PHONY: docs
docs: $(ACTIVATE) wftmpls $(NEUTRON_SAMPLE_CONFIG) component-docs-check ## Builds the documentation
$(PROPERDOCS) build --strict
.PHONY: docs-local
docs-local: $(ACTIVATE) wftmpls $(NEUTRON_SAMPLE_CONFIG) component-docs-check ## Build and locally host the documentation
$(PROPERDOCS) serve --strict --livereload