youngoli commented on a change in pull request #13290:
URL: https://github.com/apache/beam/pull/13290#discussion_r520976431



##########
File path: release/src/main/scripts/build_release_candidate.sh
##########
@@ -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}
+    fi
+  fi
+  if [[ $confirmation = "y" ]]; then # Expected to only be "n" if user chose 
to skip creating tag.

Review comment:
       Done.

##########
File path: release/src/main/scripts/build_release_candidate.sh
##########
@@ -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}

Review comment:
       Done.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to