Skip to content

Commit

Permalink
run munger over examples dir
Browse files Browse the repository at this point in the history
  • Loading branch information
lavalamp committed Jul 14, 2015
1 parent bf77ecc commit ffcc6ca
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
10 changes: 3 additions & 7 deletions hack/lib/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions hack/run-gendocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
12 changes: 12 additions & 0 deletions hack/verify-gendocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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'

Expand Down

0 comments on commit ffcc6ca

Please sign in to comment.