Skip to content

Commit 0ea4ec4

Browse files
authored
Merge pull request #6801 from oscr/find-missing-summary
📖 Add script to find files missing in SUMMARY.md
2 parents 5c5bdb7 + a29de20 commit 0ea4ec4

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ APIDIFF_OLD_COMMIT ?= $(shell git rev-parse origin/main)
454454
apidiff: $(GO_APIDIFF) ## Check for API differences
455455
$(GO_APIDIFF) $(APIDIFF_OLD_COMMIT) --print-compatible
456456

457-
ALL_VERIFY_CHECKS = doctoc boilerplate shellcheck tiltfile modules gen conversions
457+
ALL_VERIFY_CHECKS = doctoc boilerplate shellcheck tiltfile modules gen conversions capi-book-summary
458458

459459
.PHONY: verify
460460
verify: $(addprefix verify-,$(ALL_VERIFY_CHECKS)) ## Run all verify-* targets
@@ -485,6 +485,10 @@ verify-conversions: $(CONVERSION_VERIFIER) ## Verifies expected API conversion
485485
verify-doctoc:
486486
./hack/verify-doctoc.sh
487487

488+
.PHONY: verify-capi-book-summary
489+
verify-capi-book-summary:
490+
./hack/verify-capi-book-summary.sh
491+
488492
.PHONY: verify-boilerplate
489493
verify-boilerplate: ## Verify boilerplate text exists in each file
490494
./hack/verify-boilerplate.sh

docs/book/src/SUMMARY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
- [Generating a Kubeconfig](./tasks/certs/generate-kubeconfig.md)
1111
- [Kubeadm based bootstrap](./tasks/kubeadm-bootstrap.md)
1212
- [Upgrading management and workload clusters](./tasks/upgrading-clusters.md)
13+
- [External etcd](./tasks/external-etcd.md)
14+
- [Using kustomize](./tasks/using-kustomize.md)
1315
- [Upgrading Cluster API components](./tasks/upgrading-cluster-api-versions.md)
1416
- [Kubeadm based control plane management](./tasks/kubeadm-control-plane.md)
1517
- [Updating Machine Infrastructure and Bootstrap Templates](tasks/updating-machine-templates.md)
@@ -78,6 +80,7 @@
7880
- [Bootstrap](./developer/providers/bootstrap.md)
7981
- [Implementer's Guide](./developer/providers/implementers-guide/overview.md)
8082
- [Naming](./developer/providers/implementers-guide/naming.md)
83+
- [Configure](./developer/providers/implementers-guide/configure.md)
8184
- [Create Repo and Generate CRDs](./developer/providers/implementers-guide/generate_crds.md)
8285
- [Create API](./developer/providers/implementers-guide/create_api.md)
8386
- [Webhooks](./developer/providers/webhooks.md)

docs/book/src/user/guide.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

hack/verify-capi-book-summary.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# Copyright 2022 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -o errexit
18+
set -o nounset
19+
set -o pipefail
20+
21+
RESULT=0
22+
SUMMARY=$(cat ./docs/book/src/SUMMARY.md)
23+
24+
pushd ./docs/book/src > /dev/null
25+
FILES=$(find -- * -name "*.md" ! -name "SUMMARY.md")
26+
while read -r file; do
27+
if ! [[ $SUMMARY == *"${file}"* ]]; then
28+
RESULT=1
29+
echo "Didn't find $file in SUMMARY.md"
30+
fi
31+
done <<< "${FILES}"
32+
popd > /dev/null
33+
34+
exit ${RESULT}

0 commit comments

Comments
 (0)