From f08f979e439ec78fe9229265e1a9fc8c05722666 Mon Sep 17 00:00:00 2001 From: Phillip Wittrock Date: Fri, 12 Aug 2016 09:58:15 -0700 Subject: [PATCH] Update docs release script Update script for copying generated docs from kubernetes/kubernetes into kubernetes/kubernetes.github.io Make it actually do what is necessary for a new docs release --- _data/overrides.yml | 2 + update-imported-docs.sh | 98 +++++++++++++++++++++++++++++++---------- 2 files changed, 76 insertions(+), 24 deletions(-) diff --git a/_data/overrides.yml b/_data/overrides.yml index e4ca98e613..ef820044e9 100644 --- a/_data/overrides.yml +++ b/_data/overrides.yml @@ -1,6 +1,8 @@ overrides: - path: docs/api-reference - path: docs/user-guide/kubectl +- path: docs/admin/federation-apiserver.md +- path: docs/admin/federation-controller-manager.md - path: docs/admin/kube-apiserver.md - path: docs/admin/kube-controller-manager.md - path: docs/admin/kube-proxy.md diff --git a/update-imported-docs.sh b/update-imported-docs.sh index a4e49b2916..7b57099c6c 100755 --- a/update-imported-docs.sh +++ b/update-imported-docs.sh @@ -1,44 +1,38 @@ #!/bin/bash -set -x +# Uncomment this to see the commands as they are run +# set -x VERSION=1.3 -git clone --depth=1 https://github.com/kubernetes/kubernetes.git k8s +#git clone --depth=1 -b release-$VERSION https://github.com/kubernetes/kubernetes.git k8s cd k8s -git remote add upstream https://github.com/kubernetes/kubernetes.git -git fetch upstream -git checkout release-$VERSION -hack/generate-docs.sh -hack/update-generated-swagger-docs.sh -build/versionize-docs.sh release-$VERSION +#git remote add upstream https://github.com/kubernetes/kubernetes.git +#git fetch upstream +#hack/generate-docs.sh +#hack/update-generated-swagger-docs.sh +#build/versionize-docs.sh release-$VERSION cd .. - rm -rf _includes/v$VERSION mkdir _includes/v$VERSION # batch fetches while read line || [[ -n ${line} ]]; do IFS=': ' read -a myarray <<< "${line}" - #echo "arraypos0: ${myarray[0]}" - #echo "arraypos1: ${myarray[1]}" - #echo "arraypos2: ${myarray[2]}" - #echo "arraypos3: ${myarray[3]}" - if [ "${myarray[1]}" = "path" ]; then + if [ "${myarray[1]}" = "path" ]; then TARGET="${myarray[2]}" CLEARPATH="${TARGET}" K8SSOURCE='k8s/'${TARGET} DESTINATION=${TARGET%/*} rm -rf "${CLEARPATH}" - mv -f "${K8SSOURCE}" "${DESTINATION}" - # find "${DESTINATION}" -name "*${DESTINATION}" -print0 | xargs -0 sed -i '' -e 's/.html)/)/g' - fi + yes | cp -rf "${K8SSOURCE}" "${DESTINATION}" + fi if [ "${myarray[1]}" = "changedpath" ]; then SRC="${myarray[2]}" DESTINATION="${myarray[3]}" echo "mv -f ${SRC} ${DESTINATION}" - mv -f "${SRC}" "${DESTINATION}" + yes | cp -rf "${SRC}" "${DESTINATION}" fi if [ "${myarray[1]}" = "copypath" ]; then K8SSOURCE="${myarray[2]}" @@ -49,12 +43,68 @@ while read line || [[ -n ${line} ]]; do done <_data/overrides.yml # refdoc munging +pushd . cd _includes/v$VERSION -find . -name '*.html' -type f -exec sed -i -e '/