On Thu, Jan 07, 2021 at 11:42:37AM +0800, Wei Jihui wrote:
send email to user when test job failed
Signed-off-by: Wei Jihui weijihuiall@163.com
tests/email | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 tests/email
diff --git a/tests/email b/tests/email new file mode 100755 index 00000000..fe870471 --- /dev/null +++ b/tests/email @@ -0,0 +1,41 @@ +#!/bin/sh +# - my_email +# - info
+: ${info:=failure}
"$info" name could be improved. It's a bit vague.
Thanks, Fengguang
+compose_email() +{
- [ "$info" == "failure" ] && data_failure
+}
+run_email() +{
- [ -n "$my_email" ] || return 0
- my_username=$(echo "$my_email" | awk -F '@' '{print $1}')
- compose_email
- curl -XPOST "${MAIL_HOST:-$LKP_SERVER}:${MAIL_PORT:-49000}/send_mail_text" -d "$data"
+}
+run_email
2.23.0