Skip to content

Commit

Permalink
crd-ref -> api-ref for autogenerated ref pages
Browse files Browse the repository at this point in the history
Signed-off-by: Meg McRoberts <[email protected]>
  • Loading branch information
StackScribe committed Mar 29, 2023
1 parent 8ee834d commit 5f77bf6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions .github/scripts/generate-crd-docs/generate-crd-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# Inputs: None

# renovate: datasource=github-releases depName=elastic/crd-ref-docs
# renovate: datasource=github-releases depName=elastic/api-ref-docs
GENERATOR_VERSION=master
API_DOMAIN="keptn.sh"
API_ROOT='operator/apis/'
Expand All @@ -16,13 +16,13 @@ RENDERER='markdown'
RENDERER_CONFIG_FILE='.github/scripts/generate-crd-docs/crd-docs-generator-config.yaml'

echo "Checking if code generator tool is installed..."
test -s crd-ref-docs || go install github.com/elastic/crd-ref-docs@${GENERATOR_VERSION}
test -s api-ref-docs || go install github.com/elastic/api-ref-docs@${GENERATOR_VERSION}

echo "Running CRD docs auto-generator..."

for api_group in "$API_ROOT"*; do
sanitized_api_group="${api_group#$API_ROOT}"
INDEX_PATH="./docs/content/en/docs/crd-ref/$sanitized_api_group/_index.md"
INDEX_PATH="./docs/content/en/docs/api-ref/$sanitized_api_group/_index.md"

if [ ! -f "$INDEX_PATH" ]; then
echo "API group index file doesn't exist for group $sanitized_api_group. Creating it now..."
Expand All @@ -36,7 +36,7 @@ for api_group in "$API_ROOT"*; do
for api_version in "$api_group"/*; do
sanitized_api_version="${api_version#$API_ROOT$sanitized_api_group/}"

OUTPUT_PATH="./docs/content/en/docs/crd-ref/$sanitized_api_group/$sanitized_api_version"
OUTPUT_PATH="./docs/content/en/docs/api-ref/$sanitized_api_group/$sanitized_api_version"

echo "Arguments:"
echo "TEMPLATE_DIR: $TEMPLATE_DIR"
Expand All @@ -51,7 +51,7 @@ for api_group in "$API_ROOT"*; do
mkdir -p "$OUTPUT_PATH"

echo "Generating CRD docs for $sanitized_api_group.$API_DOMAIN/$sanitized_api_version..."
crd-ref-docs \
api-ref-docs \
--templates-dir "$TEMPLATE_DIR" \
--source-path="./$api_version" \
--renderer="$RENDERER" \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/markdown-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,18 @@ jobs:

- name: Copy old docs
run: |
cp -R ./docs/content/en/docs/crd-ref ./docs/content/en/docs/crd-ref-old
cp -R ./docs/content/en/docs/api-ref ./docs/content/en/docs/api-ref-old
- name: Run docs generator
run: ./.github/scripts/generate-crd-docs/generate-crd-docs.sh

- name: Check if docs are up to date
run: |
if ! diff -rq ./docs/content/en/docs/crd-ref ./docs/content/en/docs/crd-ref-old &>/dev/null; then
if ! diff -rq ./docs/content/en/docs/api-ref ./docs/content/en/docs/api-ref-old &>/dev/null; then
echo "The CRD docs have changes that are not reflected in the docs pages. Please use ./.github/scripts/generate-crd-docs/generate-crd-docs.sh to re-generate the docs."
echo ""
echo "=========== Diff ==========="
diff -ru ./docs/content/en/docs/crd-ref ./docs/content/en/docs/crd-ref-old
diff -ru ./docs/content/en/docs/api-ref ./docs/content/en/docs/api-ref-old
exit 1
else
echo ""
Expand Down
2 changes: 1 addition & 1 deletion docs/.htmltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
CheckDoctype: false
IgnoreDirs:
- favicons
- docs/crd-ref/lifecycle/
- docs/api-ref/lifecycle/
IgnoreURLs:
- "linkedin.com"
- "localhost"
Expand Down

0 comments on commit 5f77bf6

Please sign in to comment.