mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	fix run-gendocs to point to new repo location
This commit is contained in:
		
							
								
								
									
										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.
 | 
			
		||||
kube::util::gen-doc() {
 | 
			
		||||
  local cmd="$1"
 | 
			
		||||
  local dest="$2"
 | 
			
		||||
  local skipprefix="${3:-}"
 | 
			
		||||
  local base_dest="$(realpath $2)/"
 | 
			
		||||
  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 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
 | 
			
		||||
    if [[ "${file}" == *.md ]]; then
 | 
			
		||||
      local link path
 | 
			
		||||
      path=$(basename "$dest")/${file}
 | 
			
		||||
      path="$relative_doc_dest$file"
 | 
			
		||||
      link=$(kube::util::analytics-link "${path}")
 | 
			
		||||
      echo -e "\n${link}" >> "${tmpdir}/${file}"
 | 
			
		||||
    fi
 | 
			
		||||
@@ -192,7 +194,7 @@ kube::util::gen-analytics() {
 | 
			
		||||
              -not -path "${path}/Godeps/*" \
 | 
			
		||||
              -not -path "${path}/third_party/*" \
 | 
			
		||||
              -not -path "${path}/_output/*" \
 | 
			
		||||
              -not -path "${path}/docs/kubectl*" ))
 | 
			
		||||
              -not -path "${path}/docs/user-guide/kubectl/kubectl*" ))
 | 
			
		||||
  for f in "${mdfiles[@]}"; do
 | 
			
		||||
    link=$(kube::util::analytics-link "${f#${path}/}")
 | 
			
		||||
    if grep -q -F -x "${link}" "${f}"; then
 | 
			
		||||
 
 | 
			
		||||
@@ -40,9 +40,9 @@ if [[ ! -x "$gendocs" || ! -x "$genman" || ! -x "$genbashcomp" || ! -x "$mungedo
 | 
			
		||||
  exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
kube::util::gen-doc "${gendocs}" "${KUBE_ROOT}/docs/" '###### Auto generated by spf13/cobra'
 | 
			
		||||
kube::util::gen-doc "${genman}" "${KUBE_ROOT}/docs/man/man1"
 | 
			
		||||
kube::util::gen-doc "${genbashcomp}" "${KUBE_ROOT}/contrib/completions/bash/"
 | 
			
		||||
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 "${genbashcomp}" "${KUBE_ROOT}" "contrib/completions/bash/"
 | 
			
		||||
kube::util::gen-analytics "${KUBE_ROOT}"
 | 
			
		||||
 | 
			
		||||
"${mungedocs}" "--root-dir=${KUBE_ROOT}/docs/" 
 | 
			
		||||
 
 | 
			
		||||
@@ -59,8 +59,9 @@ if [[ $ret -eq 2 ]]; then
 | 
			
		||||
  exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
kube::util::gen-doc "${genman}" "${TMP_DOCROOT}/man/man1/"
 | 
			
		||||
kube::util::gen-doc "${gendocs}" "${TMP_DOCROOT}" '###### Auto generated by spf13/cobra'
 | 
			
		||||
kube::util::gen-doc "${genman}" "${_tmp}" "docs/man/man1/"
 | 
			
		||||
kube::util::gen-doc "${gendocs}" "${_tmp}" "docs/user-guide/kubectl/" '###### Auto generated by spf13/cobra'
 | 
			
		||||
 | 
			
		||||
echo "diffing ${DOCROOT} against freshly generated docs"
 | 
			
		||||
ret=0
 | 
			
		||||
diff -Naupr "${DOCROOT}" "${TMP_DOCROOT}" || ret=$?
 | 
			
		||||
@@ -82,7 +83,7 @@ fi
 | 
			
		||||
COMPROOT="${KUBE_ROOT}/contrib/completions"
 | 
			
		||||
TMP_COMPROOT="${KUBE_ROOT}/contrib/completions_tmp"
 | 
			
		||||
cp -a "${COMPROOT}" "${TMP_COMPROOT}"
 | 
			
		||||
kube::util::gen-doc "${genbashcomp}" "${TMP_COMPROOT}/bash/"
 | 
			
		||||
kube::util::gen-doc "${genbashcomp}" "${TMP_COMPROOT}" "bash/"
 | 
			
		||||
ret=0
 | 
			
		||||
diff -Naupr "${COMPROOT}" "${TMP_COMPROOT}" || ret=$?
 | 
			
		||||
rm -rf ${TMP_COMPROOT}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user