Merge "Only send autorelease failure email in releng silo"
authorJamo Luhrsen <jluhrsen@redhat.com>
Mon, 20 Mar 2017 16:05:14 +0000 (16:05 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 20 Mar 2017 16:05:14 +0000 (16:05 +0000)
jjb/autorelease/include-raw-autorelease-notify-build-failure.sh

index 09ed7c8d3ac30fed8bd4714d08bdd02bdf79a064..be274985e8564df3ecd04c7bd3a91b35e945ad11 100644 (file)
@@ -77,9 +77,18 @@ if [ ! -z "${ARTIFACTID}" ] && [[ "${BUILD_STATUS}" != "SUCCESS" ]]; then
         RELEASE_EMAIL="${RELEASE_EMAIL}, ${PROJECT}-dev@lists.opendaylight.org"
     fi
 
-    echo "${BODY}" | mail -a /tmp/error.txt \
-        -r "Jenkins <jenkins-dontreply@opendaylight.org>" \
-        -s "${SUBJECT}" "${RELEASE_EMAIL}"
+    # Only send emails in production (releng), not testing (sandbox)
+    if [ "${SILO}" == "releng" ]; then
+        echo "${BODY}" | mail -a /tmp/error.txt \
+            -r "Jenkins <jenkins-dontreply@opendaylight.org>" \
+            -s "${SUBJECT}" "${RELEASE_EMAIL}"
+    elif [ "${SILO}" == "sandbox" ]; then
+        echo "Running in sandbox, not actually sending notification emails"
+        echo "Subject: ${SUBJECT}"
+        echo "Body: ${BODY}"
+    else
+        echo "Not sure how to notify in \"${SILO}\" Jenkins silo"
+    fi
 fi
 
 rm $CONSOLE_LOG