Merge pull request #1016 from pwittrock/master

Fix update docs script
pull/1020/head
Phillip Wittrock 2016-08-11 16:42:07 -07:00 committed by GitHub
commit 3fe1b29bb5
1 changed files with 19 additions and 9 deletions

28
update-imported-docs.sh Normal file → Executable file
View File

@ -1,12 +1,22 @@
git clone https://github.com/kubernetes/kubernetes.git k8s #!/bin/bash
set -x
VERSION=1.3
git clone --depth=1 https://github.com/kubernetes/kubernetes.git k8s
cd k8s cd k8s
git checkout release-1.2 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
cd .. cd ..
rm -rf _includes/v1.2
mkdir _includes/v1.2
unalias cp rm -rf _includes/v$VERSION
mkdir _includes/v$VERSION
# batch fetches # batch fetches
while read line || [[ -n ${line} ]]; do while read line || [[ -n ${line} ]]; do
@ -39,12 +49,12 @@ while read line || [[ -n ${line} ]]; do
done <_data/overrides.yml done <_data/overrides.yml
# refdoc munging # refdoc munging
cd _includes/v1.2 cd _includes/v$VERSION
find . -name '*.html' -type f -exec sed -i '' '/<style>/,/<\/style>/d' {} \; find . -name '*.html' -type f -exec sed -i -e '/<style>/,/<\/style>/d' {} \;
find . -name '*.html' -print0 | xargs -0 sed -i '' -e 's/http:\/\/kubernetes.io\/v1.2//g' find . -name '*.html' -type f -exec sed -i -e "s/http:\/\/kubernetes.io\/v$VERSION//g" {} \;
cd .. cd ..
cd .. cd ..
rm -rf k8s rm -rf k8s
echo "Docs imported! Run 'git add .' 'git commit -m <comment>' and 'git push' to upload them" echo "Docs imported! Run 'git add .' 'git commit -m <comment>' and 'git push' to upload them"