mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
run munger over examples dir
This commit is contained in:
parent
bf77ecc3a9
commit
ffcc6cadb0
@ -144,13 +144,9 @@ kube::util::gen-doc() {
|
||||
ls "${tmpdir}" | LC_ALL=C sort > "${tmpdir}/.files_generated"
|
||||
|
||||
while read file; do
|
||||
# Add analytics link to generated .md files
|
||||
if [[ "${file}" == *.md ]]; then
|
||||
local link path
|
||||
path="${relative_doc_dest}/${file}"
|
||||
link=$(kube::util::analytics-link "${path}")
|
||||
echo -e "\n\n${link}" >> "${tmpdir}/${file}"
|
||||
fi
|
||||
# Don't add analytics link to generated .md files -- that is done (and
|
||||
# checked) by mungedocs.
|
||||
|
||||
# Remove all old generated files from the destination
|
||||
if [[ -e "${tmpdir}/${file}" ]]; then
|
||||
local original generated
|
||||
|
@ -45,10 +45,20 @@ kube::util::gen-doc "${genman}" "${KUBE_ROOT}" "docs/man/man1"
|
||||
kube::util::gen-doc "${genbashcomp}" "${KUBE_ROOT}" "contrib/completions/bash/"
|
||||
kube::util::gen-analytics "${KUBE_ROOT}"
|
||||
|
||||
"${mungedocs}" "--root-dir=${KUBE_ROOT}/docs/"
|
||||
"${mungedocs}" "--root-dir=${KUBE_ROOT}/docs/"
|
||||
ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "${KUBE_ROOT}/docs/ requires manual changes. See proceeding errors."
|
||||
echo "${KUBE_ROOT}/docs/ requires manual changes. See preceeding errors."
|
||||
exit 1
|
||||
elif [[ $ret -eq 2 ]]; then
|
||||
echo "Error running mungedocs."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"${mungedocs}" "--root-dir=${KUBE_ROOT}/examples/"
|
||||
ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "${KUBE_ROOT}/examples/ requires manual changes. See preceeding errors."
|
||||
exit 1
|
||||
elif [[ $ret -eq 2 ]]; then
|
||||
echo "Error running mungedocs."
|
||||
|
@ -40,6 +40,7 @@ if [[ ! -x "$gendocs" || ! -x "$genman" || ! -x "$genbashcomp" || ! -x "$mungedo
|
||||
fi
|
||||
|
||||
DOCROOT="${KUBE_ROOT}/docs/"
|
||||
EXAMPLEROOT="${KUBE_ROOT}/examples/"
|
||||
TMP_DOCROOT="${KUBE_ROOT}/_tmp/docs/"
|
||||
_tmp="${KUBE_ROOT}/_tmp"
|
||||
|
||||
@ -59,6 +60,17 @@ if [[ $ret -eq 2 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"${mungedocs}" "--verify=true" "--root-dir=${EXAMPLEROOT}"
|
||||
ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
echo "${EXAMPLEROOT} is out of date. Please run hack/run-gendocs.sh"
|
||||
exit 1
|
||||
fi
|
||||
if [[ $ret -eq 2 ]]; then
|
||||
echo "Error running mungedocs"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
kube::util::gen-doc "${genman}" "${_tmp}" "docs/man/man1/"
|
||||
kube::util::gen-doc "${gendocs}" "${_tmp}" "docs/user-guide/kubectl/" '###### Auto generated by spf13/cobra'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user