Merge pull request #16217 from caesarxuchao/update-versionize

versionize the include directory in definitions.md and operations.md
pull/6/head
Daniel Smith 2015-10-27 16:42:00 -07:00
commit b791642480
5 changed files with 12 additions and 4 deletions

View File

@ -27,6 +27,9 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
NEW_VERSION=${1-}
# NEW_VERSION is expected to be vMajor.Minor.Micro.
MAJOR_AND_MINOR_VERSION=${NEW_VERSION%.*}
if [ "$#" -lt 1 ]; then
echo "Usage: versionize-docs <release-version>"
exit 1
@ -45,6 +48,8 @@ echo "+++ Versioning documentation and examples"
# Update the docs to match this version.
HTML_PREVIEW_PREFIX="https://htmlpreview.github.io/\?https://github.com/kubernetes/kubernetes"
# Update the include directory in definitions.md and operations.md.
DIRECTORY_KEY_WORDS="<REPLACE-WITH-RELEASE-VERSION>"
md_dirs=(docs examples)
md_files=()
@ -60,6 +65,9 @@ for doc in "${md_files[@]}"; do
# Replace /HEAD in html preview links with /NEW_VERSION.
$SED -ri -e "s|(${HTML_PREVIEW_PREFIX})/HEAD|\1/blob/${NEW_VERSION}|g" "${doc}"
# Replace <REPLACE-WITH-RELEASE-VERSION> with MAJOR_AND_MINOR_VERSION.
$SED -ri -e "s|${DIRECTORY_KEY_WORDS}|${MAJOR_AND_MINOR_VERSION}|g" "${doc}"
is_versioned_tag="<!-- BEGIN MUNGE: IS_VERSIONED -->
<!-- TAG IS_VERSIONED -->
<!-- END MUNGE: IS_VERSIONED -->"

View File

@ -31,7 +31,7 @@ Documentation for other releases can be found at
<!-- END MUNGE: UNVERSIONED_WARNING -->
<!-- needed for gh-pages to render html files when imported -->
{% include extensions-v1beta1-definitions.html %}
{% include <REPLACE-WITH-RELEASE-VERSION>/extensions-v1beta1-definitions.html %}

View File

@ -31,7 +31,7 @@ Documentation for other releases can be found at
<!-- END MUNGE: UNVERSIONED_WARNING -->
<!-- needed for gh-pages to render html files when imported -->
{% include extensions-v1beta1-operations.html %}
{% include <REPLACE-WITH-RELEASE-VERSION>/extensions-v1beta1-operations.html %}

View File

@ -31,7 +31,7 @@ Documentation for other releases can be found at
<!-- END MUNGE: UNVERSIONED_WARNING -->
<!-- needed for gh-pages to render html files when imported -->
{% include v1-definitions.html %}
{% include <REPLACE-WITH-RELEASE-VERSION>/v1-definitions.html %}

View File

@ -31,7 +31,7 @@ Documentation for other releases can be found at
<!-- END MUNGE: UNVERSIONED_WARNING -->
<!-- needed for gh-pages to render html files when imported -->
{% include v1-operations.html %}
{% include <REPLACE-WITH-RELEASE-VERSION>/v1-operations.html %}