Add script to automate tag creation.

pull/3815/head
Thomas Stromberg 2019-03-06 17:57:17 -08:00
parent 63be8e4781
commit d62b982c56
1 changed files with 39 additions and 0 deletions

39
hack/tag_release.sh Normal file
View File

@ -0,0 +1,39 @@
#!/bin/bash
# Copyright 2018 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -eux -o pipefail
if [ "$#" -ne 1 ]; then
echo "Usage: tag_release.sh <major>.<minor>.<build>" >&2
exit 1
fi
readonly version=$1
readonly tag="v${version}"
if [[ ! "${version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "supplied version does not match expectations: ${version}"
exit 2
fi
readonly clean_repo=$(mktemp -d)
git clone --depth 1 git@github.com:kubernetes/minikube.git "${clean_repo}"
cd "${clean_repo}"
git fetch
git checkout master
git pull
git tag -a "${tag}" -m "$version Release"
git push origin "${tag}"