Commit b7916424 authored by Daniel Smith's avatar Daniel Smith

Merge pull request #16217 from caesarxuchao/update-versionize

versionize the include directory in definitions.md and operations.md
parents 3f3ca480 45b0917b
......@@ -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 -->"
......
......@@ -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 %}
......
......@@ -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 %}
......
......@@ -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 %}
......
......@@ -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 %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment