Skip to content

Commit

Permalink
Add confirmation message, remove bad rc_number (#26530)
Browse files Browse the repository at this point in the history
  • Loading branch information
damccorm authored May 3, 2023
1 parent 243c795 commit 03ecb15
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
3 changes: 1 addition & 2 deletions release/src/main/scripts/build_release_candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ if [[ $confirmation = "y" ]]; then
--repo-url "${GIT_REPO_BASE_URL}" \
--rc-tag "${RC_TAG}" \
--release-commit "${RELEASE_COMMIT}" \
--artifacts_dir "${SVN_ARTIFACTS_DIR}" \
--rc_number "${RC_NUM}"
--artifacts_dir "${SVN_ARTIFACTS_DIR}"

cd "${SVN_ARTIFACTS_DIR}"

Expand Down
52 changes: 28 additions & 24 deletions release/src/main/scripts/run_rc_validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,31 +122,35 @@ if [[ $confirmation != "y" ]]; then
exit
fi

echo "----------------- Checking published Java artifacts (should take ~1 minute) -----------------"

java_bom=$(curl "${REPO_URL}/org/apache/beam/beam-sdks-java-bom/${RELEASE_VER}/beam-sdks-java-bom-${RELEASE_VER}.pom")
artifacts=( $(echo $java_bom | grep -Eo "<artifactId>\S+?</artifactId>" | grep -Eo "beam-[a-zA-Z0-9.-]+") )
if [ ${#artifacts[@]} == 0 ];
then
echo "Couldn't find beam-sdks-java-bom in the generated java artifact."
echo "Please check ${REPO_URL} and try regenerating the java artifacts in the build_rc step."
exit 1
fi
echo "[Confirmation Required] Would you like to check published Java artifacts (if you've completed this step for this RC previously, you can safely skip this)? [y|N]"
read confirmation
if [[ $confirmation != "y" ]]; then
echo "----------------- Checking published Java artifacts (should take ~1 minute) -----------------"

java_bom=$(curl "${REPO_URL}/org/apache/beam/beam-sdks-java-bom/${RELEASE_VER}/beam-sdks-java-bom-${RELEASE_VER}.pom")
artifacts=( $(echo $java_bom | grep -Eo "<artifactId>\S+?</artifactId>" | grep -Eo "beam-[a-zA-Z0-9.-]+") )
if [ ${#artifacts[@]} == 0 ];
then
echo "Couldn't find beam-sdks-java-bom in the generated java artifact."
echo "Please check ${REPO_URL} and try regenerating the java artifacts in the build_rc step."
exit 1
fi

FAILED=()
for i in "${artifacts[@]}"
do
curl "${REPO_URL}/org/apache/beam/${i}/${RELEASE_VER}" -f || FAILED+=($i)
done
if [ ${#FAILED[@]} != 0 ];
then
echo "Failed to find the following artifacts in the generated java artifact, but they were present as dependencies in beam-sdks-java-bom:"
for i in "${FAILED[@]}"
do
echo "Artifact: ${i} - url: ${REPO_URL}/org/apache/beam/${i}/${RELEASE_VER}"
done
echo "Please check ${REPO_URL} and try regenerating the java artifacts in the build_rc step."
exit 1
FAILED=()
for i in "${artifacts[@]}"
do
curl "${REPO_URL}/org/apache/beam/${i}/${RELEASE_VER}" -f || FAILED+=($i)
done
if [ ${#FAILED[@]} != 0 ];
then
echo "Failed to find the following artifacts in the generated java artifact, but they were present as dependencies in beam-sdks-java-bom:"
for i in "${FAILED[@]}"
do
echo "Artifact: ${i} - url: ${REPO_URL}/org/apache/beam/${i}/${RELEASE_VER}"
done
echo "Please check ${REPO_URL} and try regenerating the java artifacts in the build_rc step."
exit 1
fi
fi

echo "----------------- Checking git -----------------"
Expand Down

0 comments on commit 03ecb15

Please sign in to comment.