Merge pull request #11941 from GoogleCloudPlatform/enact_version_md
Enacting versioning.md
This commit is contained in:
@@ -52,6 +52,7 @@ fi
|
||||
|
||||
release_branch="release-${VERSION_MAJOR}.${VERSION_MINOR}"
|
||||
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
head_commit=$(git rev-parse --short HEAD)
|
||||
|
||||
if [[ "${VERSION_PATCH}" != "0" ]]; then
|
||||
# sorry, no going back in time, pull latest from upstream
|
||||
@@ -93,15 +94,13 @@ echo "+++ Running ./versionize-docs"
|
||||
${KUBE_ROOT}/build/versionize-docs.sh ${NEW_VERSION}
|
||||
git commit -am "Versioning docs and examples for ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
|
||||
|
||||
dochash=$(git log -n1 --format=%H)
|
||||
|
||||
VERSION_FILE="${KUBE_ROOT}/pkg/version/base.go"
|
||||
|
||||
GIT_MINOR="${VERSION_MINOR}.${VERSION_PATCH}"
|
||||
echo "+++ Updating to ${NEW_VERSION}"
|
||||
$SED -ri -e "s/gitMajor\s+string = \"[^\"]*\"/gitMajor string = \"${VERSION_MAJOR}\"/" "${VERSION_FILE}"
|
||||
$SED -ri -e "s/gitMinor\s+string = \"[^\"]*\"/gitMinor string = \"${GIT_MINOR}\"/" "${VERSION_FILE}"
|
||||
$SED -ri -e "s/gitVersion\s+string = \"[^\"]*\"/gitVersion string = \"$NEW_VERSION\"/" "${VERSION_FILE}"
|
||||
$SED -ri -e "s/gitVersion\s+string = \"[^\"]*\"/gitVersion string = \"$NEW_VERSION-${release_branch}+\$Format:%h\$\"/" "${VERSION_FILE}"
|
||||
gofmt -s -w "${VERSION_FILE}"
|
||||
|
||||
echo "+++ Committing version change"
|
||||
@@ -110,35 +109,30 @@ git commit -m "Kubernetes version $NEW_VERSION"
|
||||
|
||||
echo "+++ Tagging version"
|
||||
git tag -a -m "Kubernetes version $NEW_VERSION" "${NEW_VERSION}"
|
||||
newtag=$(git rev-parse --short HEAD)
|
||||
|
||||
echo "+++ Updating to ${NEW_VERSION}-dev"
|
||||
$SED -ri -e "s/gitMajor\s+string = \"[^\"]*\"/gitMajor string = \"${VERSION_MAJOR}\"/" "${VERSION_FILE}"
|
||||
$SED -ri -e "s/gitMinor\s+string = \"[^\"]*\"/gitMinor string = \"${GIT_MINOR}\+\"/" "${VERSION_FILE}"
|
||||
$SED -ri -e "s/gitVersion\s+string = \"[^\"]*\"/gitVersion string = \"$NEW_VERSION-dev\"/" "${VERSION_FILE}"
|
||||
gofmt -s -w "${VERSION_FILE}"
|
||||
|
||||
echo "+++ Committing version change"
|
||||
git add "${VERSION_FILE}"
|
||||
git commit -m "Kubernetes version ${NEW_VERSION}-dev"
|
||||
if [[ "${VERSION_PATCH}" == "0" ]]; then
|
||||
declare -r alpha_ver="v${VERSION_MAJOR}.$((${VERSION_MINOR}+1)).0-alpha.0"
|
||||
git tag -a -m "Kubernetes pre-release branch ${alpha-ver}" "${alpha_ver}" "${head_commit}"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Success you must now:"
|
||||
echo ""
|
||||
echo "- Push the tag:"
|
||||
echo " git push ${push_url} v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
|
||||
echo " - Please note you are pushing the tag live BEFORE your PRs."
|
||||
echo " You need this so the builds pick up the right tag info (and so your reviewers can see it)."
|
||||
echo " If something goes wrong further down please fix the tag!"
|
||||
echo " Either delete this tag and give up, fix the tag before your next PR,"
|
||||
echo " or find someone who can help solve the tag problem!"
|
||||
echo ""
|
||||
|
||||
if [[ "${VERSION_PATCH}" == "0" ]]; then
|
||||
echo "- Send branch: ${current_branch} as a PR to ${push_url}/master"
|
||||
echo " For major/minor releases, this gets the branch tag merged and changes the version numbers."
|
||||
echo "- Push the alpha tag:"
|
||||
echo " git push ${push_url} ${alpha_ver}"
|
||||
echo "- Push the new release branch:"
|
||||
echo " git push ${push_url} ${current_branch}:${release_branch}"
|
||||
echo "- DO NOTHING TO MASTER. You were done with master when you pushed the alpha tag."
|
||||
else
|
||||
echo "- Send branch: ${current_branch} as a PR to ${release_branch} <-- NOTE THIS"
|
||||
echo " Get someone to review and merge that PR"
|
||||
echo "- In the contents of the PR, include the PRs in the release:"
|
||||
echo " hack/cherry_pick_list.sh ${current_branch}^1"
|
||||
echo " This helps cross-link PRs to patch releases they're part of in GitHub."
|
||||
echo "- Have someone review the PR. This is a mechanical review to ensure it contains"
|
||||
echo " the ${NEW_VERSION} commit, which was tagged at ${newtag}."
|
||||
fi
|
||||
|
Reference in New Issue
Block a user