@@ -15,6 +15,12 @@ GATEAY_API_VERSION ?= v1.2.0
1515DASHBOARD_VERSION ?= dev
1616TEST_TIMEOUT ?= 45m
1717
18+ # CRD Reference Documentation
19+ CRD_REF_DOCS_VERSION ?= v0.1.0
20+ CRD_REF_DOCS ?= $(LOCALBIN ) /crd-ref-docs
21+ CRD_DOCS_CONFIG ?= docs/crd/config.yaml
22+ CRD_DOCS_OUTPUT ?= docs/crd/api.md
23+
1824export KUBECONFIG = /tmp/$(KIND_NAME ) .kubeconfig
1925
2026# go
@@ -29,7 +35,6 @@ GOBIN=$(shell go env GOPATH)/bin
2935else
3036GOBIN =$(shell go env GOBIN)
3137endif
32-
3338GOOS ?= linux
3439GOARCH ?= amd64
3540
@@ -346,3 +351,29 @@ helm-build-crds:
346351sort-import :
347352 @./scripts/goimports-reviser.sh > /dev/null 2>&1
348353.PHONY : sort-import
354+
355+ .PHONY : generate-crd-docs
356+ generate-crd-docs : manifests # # Generate CRD reference documentation in a single file
357+ @mkdir -p $(dir $(CRD_DOCS_OUTPUT ) )
358+ @echo " Generating CRD reference documentation"
359+ @$(CRD_REF_DOCS ) \
360+ --source-path=./api \
361+ --config=$(CRD_DOCS_CONFIG ) \
362+ --renderer=markdown \
363+ --templates-dir=./docs/template \
364+ --output-path=$(CRD_DOCS_OUTPUT ) \
365+ --max-depth=100
366+ @echo " CRD reference documentation generated at $( CRD_DOCS_OUTPUT) "
367+
368+ .PHONY : generate-crd-docs-grouped
369+ generate-crd-docs-grouped : manifests # # Generate CRD reference documentation grouped by API group
370+ @mkdir -p docs/crd/groups
371+ @echo " Generating CRD reference documentation (grouped by API)"
372+ @$(CRD_REF_DOCS ) \
373+ --source-path=./api \
374+ --config=$(CRD_DOCS_CONFIG ) \
375+ --renderer=markdown \
376+ --templates-dir=./docs/template \
377+ --output-path=docs/crd/groups \
378+ --output-mode=group
379+ @echo " CRD reference documentation generated in docs/crd/groups directory"
0 commit comments