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"
|
ls "${tmpdir}" | LC_ALL=C sort > "${tmpdir}/.files_generated"
|
||||||
|
|
||||||
while read file; do
|
while read file; do
|
||||||
# Add analytics link to generated .md files
|
# Don't add analytics link to generated .md files -- that is done (and
|
||||||
if [[ "${file}" == *.md ]]; then
|
# checked) by mungedocs.
|
||||||
local link path
|
|
||||||
path="${relative_doc_dest}/${file}"
|
|
||||||
link=$(kube::util::analytics-link "${path}")
|
|
||||||
echo -e "\n\n${link}" >> "${tmpdir}/${file}"
|
|
||||||
fi
|
|
||||||
# Remove all old generated files from the destination
|
# Remove all old generated files from the destination
|
||||||
if [[ -e "${tmpdir}/${file}" ]]; then
|
if [[ -e "${tmpdir}/${file}" ]]; then
|
||||||
local original generated
|
local original generated
|
||||||
|
@ -48,7 +48,17 @@ kube::util::gen-analytics "${KUBE_ROOT}"
|
|||||||
"${mungedocs}" "--root-dir=${KUBE_ROOT}/docs/"
|
"${mungedocs}" "--root-dir=${KUBE_ROOT}/docs/"
|
||||||
ret=$?
|
ret=$?
|
||||||
if [[ $ret -eq 1 ]]; then
|
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
|
exit 1
|
||||||
elif [[ $ret -eq 2 ]]; then
|
elif [[ $ret -eq 2 ]]; then
|
||||||
echo "Error running mungedocs."
|
echo "Error running mungedocs."
|
||||||
|
@ -40,6 +40,7 @@ if [[ ! -x "$gendocs" || ! -x "$genman" || ! -x "$genbashcomp" || ! -x "$mungedo
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
DOCROOT="${KUBE_ROOT}/docs/"
|
DOCROOT="${KUBE_ROOT}/docs/"
|
||||||
|
EXAMPLEROOT="${KUBE_ROOT}/examples/"
|
||||||
TMP_DOCROOT="${KUBE_ROOT}/_tmp/docs/"
|
TMP_DOCROOT="${KUBE_ROOT}/_tmp/docs/"
|
||||||
_tmp="${KUBE_ROOT}/_tmp"
|
_tmp="${KUBE_ROOT}/_tmp"
|
||||||
|
|
||||||
@ -59,6 +60,17 @@ if [[ $ret -eq 2 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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 "${genman}" "${_tmp}" "docs/man/man1/"
|
||||||
kube::util::gen-doc "${gendocs}" "${_tmp}" "docs/user-guide/kubectl/" '###### Auto generated by spf13/cobra'
|
kube::util::gen-doc "${gendocs}" "${_tmp}" "docs/user-guide/kubectl/" '###### Auto generated by spf13/cobra'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user