Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-11074] build_release_candidate usability improvements. #13290

Merged
merged 2 commits into from Nov 12, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 25 additions & 12 deletions release/src/main/scripts/build_release_candidate.sh
Expand Up @@ -116,13 +116,21 @@ if [[ $confirmation = "y" ]]; then
echo "-------------Building Java Artifacts with Gradle-------------"
git config credential.helper store

./gradlew release -Prelease.newVersion=${RELEASE}-SNAPSHOT \
-Prelease.releaseVersion=${RELEASE}-RC${RC_NUM} \
-Prelease.useAutomaticVersion=true --info --no-daemon

git push origin "${RELEASE_BRANCH}"
git push origin "v${RELEASE}-RC${RC_NUM}"

if git rev-parse "v${RELEASE}-RC${RC_NUM}" >/dev/null 2>&1; then
echo "Tag v${RELEASE}-RC${RC_NUM} already exists."
echo "Delete the tag and create a new tag commit (y) or skip this step (n)? [y/N]"
read confirmation
if [[ $confirmation = "y" ]]; then
git push origin :refs/tags/v${RELEASE}-RC${RC_NUM}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment explaining how this deletes the tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

fi
fi
if [[ $confirmation = "y" ]]; then # Expected to only be "n" if user chose to skip creating tag.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [[ $confirmation = "y" ]]; then # Expected to only be "n" if user chose to skip creating tag.
if [[ $confirmation = "y" ]]; then # Expected to be "y" unless user chose to skip creating tag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

./gradlew release -Prelease.newVersion=${RELEASE}-SNAPSHOT \
-Prelease.releaseVersion=${RELEASE}-RC${RC_NUM} \
-Prelease.useAutomaticVersion=true --info --no-daemon
git push origin "${RELEASE_BRANCH}"
git push origin "v${RELEASE}-RC${RC_NUM}"
fi
echo "-------------Staging Java Artifacts into Maven---------------"
gpg --local-user ${SIGNING_KEY} --output /dev/null --sign ~/.bashrc
./gradlew publish -Psigning.gnupg.keyName=${SIGNING_KEY} -PisRelease --no-daemon
Expand Down Expand Up @@ -162,9 +170,15 @@ if [[ $confirmation = "y" ]]; then
echo "----Creating Hash Value for ${SOURCE_RELEASE_ZIP}----"
sha512sum ${SOURCE_RELEASE_ZIP} > ${SOURCE_RELEASE_ZIP}.sha512

# The svn commit is interactive already and can be aborted by deleted the commit msg
svn add --force .
svn commit --no-auth-cache
svn status
echo "Please confirm these changes are ready to commit: [y|N] "
read confirmation
if [[ $confirmation != "y" ]]; then
echo "Exit without staging source release on dist.apache.org."
else
svn commit --no-auth-cache --non-interactive -m "Staging Java artifacts for Apache Beam ${RELEASE} RC${RC_NUM}"
fi
rm -rf ~/${LOCAL_JAVA_STAGING_DIR}
fi

Expand Down Expand Up @@ -228,10 +242,9 @@ if [[ $confirmation = "y" ]]; then
read confirmation
if [[ $confirmation != "y" ]]; then
echo "Exit without staging python artifacts on dist.apache.org."
rm -rf "${HOME:?}/${LOCAL_PYTHON_STAGING_DIR}"
exit
else
svn commit --no-auth-cache --non-interactive -m "Staging Python artifacts for Apache Beam ${RELEASE} RC${RC_NUM}"
fi
svn commit --no-auth-cache
rm -rf "${HOME:?}/${LOCAL_PYTHON_STAGING_DIR}"
fi

Expand Down