Repository: aurora Updated Branches: refs/heads/master b847db8d7 -> 2026ca040
Improve cleanup hints in release and release-candidate scripts Reviewed at https://reviews.apache.org/r/58612/ Project: http://git-wip-us.apache.org/repos/asf/aurora/repo Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/2026ca04 Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/2026ca04 Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/2026ca04 Branch: refs/heads/master Commit: 2026ca04029134abcb5e41b5945274ef96662295 Parents: b847db8 Author: Stephan Erb <s...@apache.org> Authored: Fri Apr 21 18:39:48 2017 +0200 Committer: Stephan Erb <s...@apache.org> Committed: Fri Apr 21 18:39:48 2017 +0200 ---------------------------------------------------------------------- build-support/release/release | 21 +++++++++++++++++++-- build-support/release/release-candidate | 3 ++- 2 files changed, 21 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/aurora/blob/2026ca04/build-support/release/release ---------------------------------------------------------------------- diff --git a/build-support/release/release b/build-support/release/release index 05a2e02..04479f5 100755 --- a/build-support/release/release +++ b/build-support/release/release @@ -125,6 +125,22 @@ if [[ $publish == 0 ]]; then fi dist_name="apache-aurora-${current_version}" +dist_dir=${base_dir}/dist + +function print_reset_instructions { +cat <<EOF +To roll back your local repo you will need to run: + + rm -rf ${dist_dir} +EOF +} + +# If anything goes wrong from here then print roll back instructions before exiting. +function print_rollback_instructions { + echo "ERROR: Looks like something has failed while creating the release." + print_reset_instructions +} +trap print_rollback_instructions EXIT if [[ $publish == 1 ]]; then # Create release branch and tag and push them to the origin @@ -140,7 +156,6 @@ if [[ $publish == 1 ]]; then git push origin "${current_version_tag}" fi -dist_dir=${base_dir}/dist rc_dir=${dist_dir}/rc release_dir=${dist_dir}/${current_version} mkdir -p ${rc_dir} @@ -244,7 +259,9 @@ if [[ $publish == 0 ]]; then echo echo "This is a dry run, nothing has been published." echo - echo "To clean up run: rm -rf ${dist_dir}" + print_reset_instructions fi +# Unset error message handler and exit +trap '' EXIT exit 0 http://git-wip-us.apache.org/repos/asf/aurora/blob/2026ca04/build-support/release/release-candidate ---------------------------------------------------------------------- diff --git a/build-support/release/release-candidate b/build-support/release/release-candidate index 80b14ea..fa316d4 100755 --- a/build-support/release/release-candidate +++ b/build-support/release/release-candidate @@ -156,7 +156,8 @@ To roll back your local repo you will need to run: git checkout master git reset --hard ${current_git_rev} - git tag -D ${rc_version_tag} + git branch -D "stage_${rc_version_tag}" + git tag -d ${rc_version_tag} EOF }