forked from rook/rook
Currently, if there is any change in the API we need to separately run the make generate-crd-docs but with this change make crds will also update the generated docs Also improved the file locations Closes: https://github.com/rook/rook/issues/12310 Signed-off-by: parth-gr <paarora@redhat.com>
26 lines
822 B
Bash
Executable File
26 lines
822 B
Bash
Executable File
#! /usr/bin/env bash
|
|
|
|
SCRIPT_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)
|
|
GEN_CRD_API_REFERENCE_DOC_VERSION=v0.3.0
|
|
SPECIFICATION_FILE=Documentation/CRDs/specification.md
|
|
|
|
install_generator() {
|
|
go install github.com/ahmetb/gen-crd-api-reference-docs@${GEN_CRD_API_REFERENCE_DOC_VERSION}
|
|
}
|
|
|
|
run_gen() {
|
|
if [[ $SKIP_GEN_CRD_DOCS = true ]]; then
|
|
echo "SKIP_GEN_CRD_DOCS is set, skipping CRD docs generation"
|
|
else
|
|
echo "rebuilding specification.md"
|
|
install_generator
|
|
${GOBIN}/gen-crd-api-reference-docs \
|
|
-config="${SCRIPT_ROOT}/build/crds/crd-docs-config.json" \
|
|
-template-dir="${SCRIPT_ROOT}/Documentation/gen-crd-api-reference-docs/template" \
|
|
-api-dir="github.com/rook/rook/pkg/apis/ceph.rook.io" \
|
|
-out-file="${SCRIPT_ROOT}/$SPECIFICATION_FILE"
|
|
fi
|
|
}
|
|
|
|
run_gen
|