Skip to content

Commit

Permalink
versionize the include directory in definitions.md and operations.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Chao Xu committed Oct 26, 2015
1 parent 88548e2 commit 45b0917
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions build/versionize-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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=()
Expand All @@ -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 -->"
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/extensions/v1beta1/definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}



Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/extensions/v1beta1/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}



Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/v1/definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}



Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/v1/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}



Expand Down

0 comments on commit 45b0917

Please sign in to comment.