Changing the path at which federation api reference docs are copied

This commit is contained in:
nikhiljindal 2016-09-14 18:24:18 -07:00
parent c251733348
commit dccb798817
2 changed files with 38 additions and 18 deletions

View File

@ -8,11 +8,11 @@ overrides:
- path: docs/admin/kube-proxy.md
- path: docs/admin/kube-scheduler.md
- path: docs/admin/kubelet.md
- path: federation/docs/api-reference
- changedpath: docs/api-reference/extensions/v1beta1/definitions.html _includes/v1.4/extensions-v1beta1-definitions.html
- changedpath: docs/api-reference/extensions/v1beta1/operations.html _includes/v1.4/extensions-v1beta1-operations.html
- changedpath: docs/api-reference/v1/definitions.html _includes/v1.4/v1-definitions.html
- changedpath: docs/api-reference/v1/operations.html _includes/v1.4/v1-operations.html
- copypath: k8s/federation/docs/api-reference/ docs/federation/
- copypath: k8s/cluster/saltbase/salt/fluentd-gcp/fluentd-gcp.yaml docs/getting-started-guides/fluentd-gcp.yaml
- copypath: k8s/examples/blog-logging/counter-pod.yaml docs/getting-started-guides/counter-pod.yaml
- copypath: k8s/examples/blog-logging/counter-pod.yaml docs/user-guide/counter-pod.yaml

View File

@ -5,6 +5,33 @@
VERSION=1.4
# Processes api reference docs.
function process_api_ref_docs {
# Replace html preview links by relative links to let k8s.io render them.
local html_preview_prefix="https:\/\/htmlpreview.github.io\/?https:\/\/github.com\/kubernetes\/kubernetes\/blob\/"
find . -name '*.*' -type f -exec sed -i -e "s/${html_preview_prefix}HEAD//g" {} \;
find . -name '*.*' -type f -exec sed -i -e "s/${html_preview_prefix}release-$VERSION//g" {} \;
# Format html
find . -name '*.html' -type f -exec sed -i -e '/<style>/,/<\/style>/d' {} \;
find . -name '*.html' -type f -exec sed -i -e "s/http:\/\/kubernetes.io\/v$VERSION//g" {} \;
find . -name '*.html' -type f -exec sed -i -e '1 i\
---' {} \;
find . -name '*.html' -type f -exec sed -i -e '1 i\
---' {} \;
# Strip the munge comments
find . -name '*.md' -type f -exec sed -i -e '/<!-- BEGIN MUNGE: IS_VERSIONED -->/,/<!-- END MUNGE: IS_VERSIONED -->/d' {} \;
find . -name '*.md' -type f -exec sed -i -e '/<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->/,/<!-- END MUNGE: UNVERSIONED_WARNING -->/d' {} \;
# Add the expected headers to md files
find . -name '*.md' -type f -exec sed -i -e '1 i\
---' {} \;
find . -name '*.md' -type f -exec sed -i -e '1 i\
---' {} \;
}
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
@ -54,28 +81,21 @@ popd
pushd .
cd docs/api-reference
# Format html
find . -name '*.html' -type f -exec sed -i -e '/<style>/,/<\/style>/d' {} \;
find . -name '*.html' -type f -exec sed -i -e "s/http:\/\/kubernetes.io\/v$VERSION//g" {} \;
find . -name '*.html' -type f -exec sed -i -e '1 i\
---' {} \;
find . -name '*.html' -type f -exec sed -i -e '1 i\
---' {} \;
# Strip the munge comments
find . -name '*.md' -type f -exec sed -i -e '/<!-- BEGIN MUNGE: IS_VERSIONED -->/,/<!-- END MUNGE: IS_VERSIONED -->/d' {} \;
find . -name '*.md' -type f -exec sed -i -e '/<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->/,/<!-- END MUNGE: UNVERSIONED_WARNING -->/d' {} \;
# Add the expected headers to md files
find . -name '*.md' -type f -exec sed -i -e '1 i\
---' {} \;
find . -name '*.md' -type f -exec sed -i -e '1 i\
---' {} \;
process_api_ref_docs
# Fix for bug in 1.3 release
find . -name '*.md' -type f -exec sed -i -e "s/vv1.3.0-beta.0/v1.3/g" {} \;
popd
pushd .
cd docs/federation/api-reference
process_api_ref_docs
# Update the links from federation/docs/api-reference to
# docs/federation/api-reference
find . -name '*.*' -type f -exec sed -i -e "s/federation\/docs\/api-reference/docs\/federation\/api-reference/g" {} \;
popd
pushd .
cd docs/user-guide/kubectl
# Strip the munge comments