CONSOLE_LOG="/tmp/autorelease-build.log"
STREAM=${JOB_NAME#*-*e-}
-BODY="Please refer to the logs server URL for console logs when possible
-and use the Jenkins Build URL as a last resort.
-
-Console Logs URL:
-https://logs.opendaylight.org/$SILO/$ARCHIVES_DIR
-
-Jenkins Build URL:
-$BUILD_URL"
-
# get console logs
wget -O $CONSOLE_LOG ${BUILD_URL}consoleText
ARTIFACTID=`echo ${REACTOR_INFO} | awk '{ gsub(/^[ \t]+|[ \t]+$/, ""); print }'`
fi
+# Construct email subject & body
+PROJECT_STRING=${PROJECT:+" from $PROJECT"}
+SUBJECT="[release] Autorelease $STREAM failed to build $ARTIFACTID$PROJECT_STRING"
+BODY="Attention$PROJECT_STRING,
+
+Autorelease $STREAM failed to build $ARTIFACTID$PROJECT_STRING in build
+$BUILD_NUMBER. Attached is a snippet of the error message related to the
+failure that we were able to automatically parse as well as console logs.
+
+Console Logs:
+https://logs.opendaylight.org/$SILO/$ARCHIVES_DIR
+
+Jenkins Build:
+$BUILD_URL
+
+Please review and provide an ETA on when a fix will be available.
+
+Thanks,
+ODL releng/autorelease team
+"
+
# check if remote staging is complete successfully
BUILD_STATUS=`awk '/\[INFO\] Remote staging finished/{flag=1;next} \
/Total time:/{flag=0}flag' $CONSOLE_LOG \
sed -e "/\[INFO\] Building \(${ARTIFACTID} \|${ODL} :: ${PROJECT} :: ${ARTIFACTID} \)/,/Reactor Summary:/!d;//d" \
$CONSOLE_LOG > /tmp/error_msg
- if [ -z "${PROJECT}" ]; then
- PROJECT=${ARTIFACTID}
- else
+ if [ -n "${PROJECT}" ]; then
RELEASE_EMAIL="${RELEASE_EMAIL}, ${PROJECT}-dev@opendaylight.org"
fi
- SUBJECT="[release] Autorelease ${STREAM} build failure: ${PROJECT}"
-
echo "${BODY}" | mail -a /tmp/error_msg -s "${SUBJECT}" "${RELEASE_EMAIL}"
fi