blob: 8b755011b7f9113874dbbf207a1ef4197245a8b1 [file] [log] [blame]
#!/bin/sh
pom_files=$(find $RELEASE_FOLDER -name '*.pom')
failed=0
unknown=0
echo ""
for pom_file in ${pom_files}; do
artifactId=$(xmllint --xpath "/*[local-name()='project']/*[local-name()='artifactId']/text()" ${pom_file})
version=$(xmllint --xpath "/*[local-name()='project']/*[local-name()='version']/text()" ${pom_file})
repo_name="${artifactId//\./-}"
if [[ $repo_name != sling-* ]]; then
repo_name="sling-${repo_name}"
fi
echo -n "STATUS: ${artifactId} ${version}: "
resp=$(curl --silent -H 'Accept: application/vnd.github.v3+json' \
"https://api.github.com/repos/apache/${repo_name}/commits/${artifactId}-${version}/status")
status=$(echo $resp | jq --raw-output '.state')
echo $status
case $status in
"pending")
unknown=1
;;
"failure")
failed=1
;;
esac
if [[ $status != "success" ]]; then
echo "See https://github.com/apache/${repo_name}/commits/${artifactId}-${version} for details"
echo $resp | jq -r '.statuses[] | "Additional Information: \"" + .description + "\" See: " + .target_url'
fi
echo ""
done
if [ $failed -eq 1 ]; then
exit 1
fi
if [ $unknown -eq 1 ]; then
exit 129
fi
exit 0