diff --git a/hack/lib/util.sh b/hack/lib/util.sh index 593b7780543..8fa0fb5393a 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -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 diff --git a/hack/run-gendocs.sh b/hack/run-gendocs.sh index 5b32fc712ef..c7c22cdc182 100755 --- a/hack/run-gendocs.sh +++ b/hack/run-gendocs.sh @@ -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." diff --git a/hack/verify-gendocs.sh b/hack/verify-gendocs.sh index 718395ccaf7..c4bda4bd5f9 100755 --- a/hack/verify-gendocs.sh +++ b/hack/verify-gendocs.sh @@ -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'