fix run-gendocs to point to new repo location
This commit is contained in:
parent
0e8d521eed
commit
b4514ee1f3
10
hack/lib/util.sh
Normal file → Executable file
10
hack/lib/util.sh
Normal file → Executable file
@ -123,8 +123,10 @@ kube::util::wait-for-jobs() {
|
|||||||
# that match $3, copy is skipped.
|
# that match $3, copy is skipped.
|
||||||
kube::util::gen-doc() {
|
kube::util::gen-doc() {
|
||||||
local cmd="$1"
|
local cmd="$1"
|
||||||
local dest="$2"
|
local base_dest="$(realpath $2)/"
|
||||||
local skipprefix="${3:-}"
|
local relative_doc_dest="$3"
|
||||||
|
local dest="${base_dest}${relative_doc_dest}"
|
||||||
|
local skipprefix="${4:-}"
|
||||||
|
|
||||||
# We do this in a tmpdir in case the dest has other non-autogenned files
|
# We do this in a tmpdir in case the dest has other non-autogenned files
|
||||||
# We don't want to include them in the list of gen'd files
|
# We don't want to include them in the list of gen'd files
|
||||||
@ -139,7 +141,7 @@ kube::util::gen-doc() {
|
|||||||
# Add analytics link to generated .md files
|
# Add analytics link to generated .md files
|
||||||
if [[ "${file}" == *.md ]]; then
|
if [[ "${file}" == *.md ]]; then
|
||||||
local link path
|
local link path
|
||||||
path=$(basename "$dest")/${file}
|
path="$relative_doc_dest$file"
|
||||||
link=$(kube::util::analytics-link "${path}")
|
link=$(kube::util::analytics-link "${path}")
|
||||||
echo -e "\n${link}" >> "${tmpdir}/${file}"
|
echo -e "\n${link}" >> "${tmpdir}/${file}"
|
||||||
fi
|
fi
|
||||||
@ -192,7 +194,7 @@ kube::util::gen-analytics() {
|
|||||||
-not -path "${path}/Godeps/*" \
|
-not -path "${path}/Godeps/*" \
|
||||||
-not -path "${path}/third_party/*" \
|
-not -path "${path}/third_party/*" \
|
||||||
-not -path "${path}/_output/*" \
|
-not -path "${path}/_output/*" \
|
||||||
-not -path "${path}/docs/kubectl*" ))
|
-not -path "${path}/docs/user-guide/kubectl/kubectl*" ))
|
||||||
for f in "${mdfiles[@]}"; do
|
for f in "${mdfiles[@]}"; do
|
||||||
link=$(kube::util::analytics-link "${f#${path}/}")
|
link=$(kube::util::analytics-link "${f#${path}/}")
|
||||||
if grep -q -F -x "${link}" "${f}"; then
|
if grep -q -F -x "${link}" "${f}"; then
|
||||||
|
@ -40,9 +40,9 @@ if [[ ! -x "$gendocs" || ! -x "$genman" || ! -x "$genbashcomp" || ! -x "$mungedo
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
kube::util::gen-doc "${gendocs}" "${KUBE_ROOT}/docs/" '###### Auto generated by spf13/cobra'
|
kube::util::gen-doc "${gendocs}" "${KUBE_ROOT}" "docs/user-guide/kubectl/" '###### Auto generated by spf13/cobra'
|
||||||
kube::util::gen-doc "${genman}" "${KUBE_ROOT}/docs/man/man1"
|
kube::util::gen-doc "${genman}" "${KUBE_ROOT}" "docs/man/man1"
|
||||||
kube::util::gen-doc "${genbashcomp}" "${KUBE_ROOT}/contrib/completions/bash/"
|
kube::util::gen-doc "${genbashcomp}" "${KUBE_ROOT}" "contrib/completions/bash/"
|
||||||
kube::util::gen-analytics "${KUBE_ROOT}"
|
kube::util::gen-analytics "${KUBE_ROOT}"
|
||||||
|
|
||||||
"${mungedocs}" "--root-dir=${KUBE_ROOT}/docs/"
|
"${mungedocs}" "--root-dir=${KUBE_ROOT}/docs/"
|
||||||
|
@ -59,8 +59,9 @@ if [[ $ret -eq 2 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
kube::util::gen-doc "${genman}" "${TMP_DOCROOT}/man/man1/"
|
kube::util::gen-doc "${genman}" "${_tmp}" "docs/man/man1/"
|
||||||
kube::util::gen-doc "${gendocs}" "${TMP_DOCROOT}" '###### Auto generated by spf13/cobra'
|
kube::util::gen-doc "${gendocs}" "${_tmp}" "docs/user-guide/kubectl/" '###### Auto generated by spf13/cobra'
|
||||||
|
|
||||||
echo "diffing ${DOCROOT} against freshly generated docs"
|
echo "diffing ${DOCROOT} against freshly generated docs"
|
||||||
ret=0
|
ret=0
|
||||||
diff -Naupr "${DOCROOT}" "${TMP_DOCROOT}" || ret=$?
|
diff -Naupr "${DOCROOT}" "${TMP_DOCROOT}" || ret=$?
|
||||||
@ -82,7 +83,7 @@ fi
|
|||||||
COMPROOT="${KUBE_ROOT}/contrib/completions"
|
COMPROOT="${KUBE_ROOT}/contrib/completions"
|
||||||
TMP_COMPROOT="${KUBE_ROOT}/contrib/completions_tmp"
|
TMP_COMPROOT="${KUBE_ROOT}/contrib/completions_tmp"
|
||||||
cp -a "${COMPROOT}" "${TMP_COMPROOT}"
|
cp -a "${COMPROOT}" "${TMP_COMPROOT}"
|
||||||
kube::util::gen-doc "${genbashcomp}" "${TMP_COMPROOT}/bash/"
|
kube::util::gen-doc "${genbashcomp}" "${TMP_COMPROOT}" "bash/"
|
||||||
ret=0
|
ret=0
|
||||||
diff -Naupr "${COMPROOT}" "${TMP_COMPROOT}" || ret=$?
|
diff -Naupr "${COMPROOT}" "${TMP_COMPROOT}" || ret=$?
|
||||||
rm -rf ${TMP_COMPROOT}
|
rm -rf ${TMP_COMPROOT}
|
||||||
|
Loading…
Reference in New Issue
Block a user