release: support kick off release in current branch

Currently when triggering release, it always pull remote repo and
checkout main branch. Any changes which are merged into the target
release branch (e.g. release-3.5) will be ignored. It isn't
convenient for test, including in github workflow and local environment.
So we need to support triggering release in current branch.

Note: --current-branch should only be called with DRY_RUN=true

Signed-off-by: Benjamin Wang <wachao@vmware.com>
This commit is contained in:
Benjamin Wang
2022-11-26 19:17:52 +08:00
parent 64599b4072
commit 5d78d6d4b1
4 changed files with 53 additions and 22 deletions

View File

@ -7,7 +7,6 @@ source ./scripts/test_lib.sh
VER=$1
REPOSITORY="${REPOSITORY:-git@github.com:etcd-io/etcd.git}"
if [ -z "$1" ]; then
echo "Usage: ${0} VERSION" >> /dev/stderr
exit 255
@ -25,9 +24,7 @@ function setup_env {
pushd "${proj}" >/dev/null
run git fetch --all
git_assert_branch_in_sync || exit 2
run git checkout "${ver}"
git_assert_branch_in_sync || exit 2
popd >/dev/null
}