mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-07 04:03:20 +00:00
Revamp doc generation
Auto generated docs are **NO LONGER CHECKED IN**, only placeholders. To generate them, e.g. before exporting docs, run hack/generate-docs.sh. hack/verify-generated-docs.sh ensures that generated docs are merely the placeholder text. hack/update-generated-docs.sh puts the placeholder text in the proper places. The old munge behavior is moved into hack/{update|verify}-munge-docs.sh.
This commit is contained in:
52
hack/generate-docs.sh
Executable file
52
hack/generate-docs.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# This file is not intended to be run automatically. It is meant to be run
|
||||
# immediately before exporting docs. We do not want to check these documents in
|
||||
# by default.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/build-go.sh" \
|
||||
cmd/gendocs \
|
||||
cmd/genkubedocs \
|
||||
cmd/genman \
|
||||
cmd/genyaml \
|
||||
federation/cmd/genfeddocs
|
||||
|
||||
kube::util::ensure-temp-dir
|
||||
|
||||
kube::util::gen-docs "${KUBE_TEMP}"
|
||||
|
||||
# remove all of the old docs
|
||||
kube::util::remove-gen-docs
|
||||
|
||||
# Copy fresh docs into the repo.
|
||||
# the shopt is so that we get .generated_docs from the glob.
|
||||
shopt -s dotglob
|
||||
cp -af "${KUBE_TEMP}"/* "${KUBE_ROOT}"
|
||||
shopt -u dotglob
|
||||
|
||||
echo "Generated docs have been placed in the repository tree. Running hack/update-munge-docs.sh."
|
||||
|
||||
"${KUBE_ROOT}/hack/update-munge-docs.sh"
|
Reference in New Issue
Block a user