From e7189041eed7dc535600210a521afd9fade94ce0 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Thu, 2 Jul 2015 12:59:45 -0700 Subject: [PATCH] Preprocess API files to version URLs upon release --- build/mark-new-version.sh | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/build/mark-new-version.sh b/build/mark-new-version.sh index 9349dcc87f6..b06014b054c 100755 --- a/build/mark-new-version.sh +++ b/build/mark-new-version.sh @@ -89,24 +89,21 @@ if ! ("$SED" --version 2>&1 | grep -q GNU); then echo "!!! GNU sed is required. If on OS X, use 'brew install gnu-sed'." fi +echo "+++ Versioning documentation and examples" + +# Update the docs to match this version. +perl -pi -e "s/HEAD/${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}/" docs/README.md +perl -pi -e "s/HEAD/${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}/" examples/README.md + +# Update API descriptions to match this version. +perl -pi -e "s|(releases.k8s.io)/HEAD|\$1/${NEW_VERSION}|" pkg/api/v[0-9]*/types.go + +${KUBE_ROOT}/hack/run-gendocs.sh +${KUBE_ROOT}/hack/update-swagger-spec.sh +git commit -am "Versioning docs and examples for ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" + VERSION_FILE="${KUBE_ROOT}/pkg/version/base.go" -if [[ "${VERSION_PATCH}" == "0" ]]; then - RELEASE_DIR=release-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} - echo "+++ Cloning documentation and examples into ${RELEASE_DIR}/..." - mkdir ${RELEASE_DIR} - cp -r docs ${RELEASE_DIR}/docs - cp -r examples ${RELEASE_DIR}/examples - - # Update the docs to match this version. - perl -pi -e "s/HEAD/${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}/" ${RELEASE_DIR}/docs/README.md - perl -pi -e "s/HEAD/${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}/" ${RELEASE_DIR}/examples/README.md - - ${KUBE_ROOT}/hack/run-gendocs.sh - git add ${RELEASE_DIR} - git commit -m "Cloning docs for ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" -fi - GIT_MINOR="${VERSION_MINOR}.${VERSION_PATCH}" echo "+++ Updating to ${NEW_VERSION}" "$SED" -r -i -e "s/gitMajor\s+string = \"[^\"]*\"/gitMajor string = \"${VERSION_MAJOR}\"/" "${VERSION_FILE}"