X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=inline;f=jjb%2Fautorelease%2Fnotify-build-failure.sh;h=0e3fe29b4f3fed4d86795a2716cbe4bea83cae62;hb=d7c3880fe4578a70a16e2237bb8be8a1742c0291;hp=e17ce7f843dce3827ab81d3f66514b8352b26f13;hpb=417035461954a2a53ae3c2c3037042cc92592f75;p=releng%2Fbuilder.git diff --git a/jjb/autorelease/notify-build-failure.sh b/jjb/autorelease/notify-build-failure.sh index e17ce7f84..0e3fe29b4 100644 --- a/jjb/autorelease/notify-build-failure.sh +++ b/jjb/autorelease/notify-build-failure.sh @@ -11,6 +11,8 @@ # This script parses the console log to discover which project has caused a # build failure and notify the project as appropriate. +echo "---> notify-build-failure.sh" + NEWLINE=$'\n' RELEASE_EMAIL="release@lists.opendaylight.org" ARCHIVES_DIR="$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER" @@ -69,6 +71,7 @@ if [ ! -z "$ARTIFACT_ID" ]; then --else -o ""\ "$p" 2>/dev/null) if [ ! -z "${GROUP}" ]; then + # shellcheck disable=SC2207 grouplist+=($(echo "${GROUP}" | awk -F'.' '{ print $3 }')) fi done < <(find . -name "pom.xml") @@ -125,24 +128,24 @@ if ([ ! -z "${NAME}" ] || [ ! -z "${ARTIFACT_ID}" ]) && [[ "${BUILD_STATUS}" != $CONSOLE_LOG | gzip > "$ERROR_LOG" if [ -n "${PROJECT}" ]; then - RELEASE_EMAIL="\${RELEASE_EMAIL}, \${PROJECT}-dev@lists.opendaylight.org" + RELEASE_EMAIL="${RELEASE_EMAIL}, ${PROJECT}-dev@lists.opendaylight.org" fi file_size=$(du -k "$ERROR_LOG" | cut -f1) - PARAMS=("-r \"Jenkins \"") - PARAMS+=("-s \"$SUBJECT\"") # Only send emails in production (releng), not testing (sandbox) if [ "${SILO}" == "releng" ]; then if [[ "$file_size" -gt 100 ]]; then # shellcheck disable=SC2034 ATTACHMENT=ATTACHMENT_EXCLUDE + eval echo \""${BODY}"\" | mail \ + -r "Jenkins " \ + -s "${SUBJECT}" "${RELEASE_EMAIL}" else - PARAMS+=("-a \"$ERROR_LOG\"") + eval echo \""${BODY}"\" | mail -a "$ERROR_LOG" \ + -r "Jenkins " \ + -s "${SUBJECT}" "${RELEASE_EMAIL}" fi - - eval echo \""${BODY}"\" | eval mail "${PARAMS[*]}" "${RELEASE_EMAIL}" - elif [ "${SILO}" == "sandbox" ]; then echo "Running in sandbox, not actually sending notification emails" echo "Subject: ${SUBJECT}"