Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion release/src/main/scripts/run_rc_validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ HUB_ARTIFACTS_NAME=hub-linux-amd64-${HUB_VERSION}
BACKUP_BASHRC=.bashrc_backup_$(date +"%Y%m%d%H%M%S")
BACKUP_M2=settings_backup_$(date +"%Y%m%d%H%M%S").xml
declare -a PYTHON_VERSIONS_TO_VALIDATE=("python3.8")

echo ""
echo "====================Checking Environment & Variables================="
echo "PLEASE update RC_VALIDATE_CONFIGS in file script.config first."
Expand All @@ -123,6 +122,33 @@ 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

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

echo "----------------- Checking git -----------------"
if [[ -z ${GITHUB_TOKEN} ]]; then
echo "Error: A Github personal access token is required to perform git push "
Expand Down