Revert "Use eval command to append mail options" 57/66157/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 1 Dec 2017 15:12:14 +0000 (10:12 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 1 Dec 2017 15:27:13 +0000 (10:27 -0500)
The original commit introduces a regression in our ability to send
emails to the correct mailing lists.

This reverts commit ea26afb7d635a615547490e05a7aef2d9bcda265.

Issue: RELENG-70
Change-Id: If493d40462d12edba2913971ba145a3d2b4a75e9
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb/autorelease/notify-build-failure.sh

index e17ce7f843dce3827ab81d3f66514b8352b26f13..090e808039b1213b3c39127328813fc179737234 100644 (file)
@@ -125,24 +125,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 <jenkins-dontreply@opendaylight.org>\"")
-    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 <jenkins-dontreply@opendaylight.org>" \
+                -s "${SUBJECT}" "${RELEASE_EMAIL}"
         else
-            PARAMS+=("-a \"$ERROR_LOG\"")
+            eval echo \""${BODY}"\" | mail -a "$ERROR_LOG" \
+                -r "Jenkins <jenkins-dontreply@opendaylight.org>" \
+                -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}"