[skip ci] Update email (#13087)

Signed-off-by: Jenny Li <jing.li@zilliz.com>
pull/13088/head
Jenny Li 2021-12-09 18:15:04 +08:00 committed by GitHub
parent a73be6d190
commit 7113f23214
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 12 deletions

View File

@ -192,20 +192,25 @@ pipeline {
}
}
}
unsuccessful {
container('jnlp') {
script {
def authorEmail = sh returnStdout: true, script: 'git --no-pager show -s --format=\'%ae\' HEAD'
emailext subject: '$DEFAULT_SUBJECT',
body: '$DEFAULT_CONTENT',
recipientProviders: [developers(), culprits()],
replyTo: '$DEFAULT_REPLYTO',
to: "${authorEmail},devops@zilliz.com"
}
}
}
}
}
post{
unsuccessful {
container('jnlp') {
dir ('tests/scripts') {
script {
def authorEmail = sh(returnStdout: true, script: './get_author_email.sh ')
emailext subject: '$DEFAULT_SUBJECT',
body: '$DEFAULT_CONTENT',
recipientProviders: [developers(), culprits()],
replyTo: '$DEFAULT_REPLYTO',
to: "${authorEmail},devops@zilliz.com"
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
function get_author_email(){
email=$(git --no-pager show -s --format=\'%ae\' HEAD )
if [[ "${email}" == 'nobody@nowhere' ]]; then
email=$(git --no-pager show -s --format=\'%ae\' HEAD^ )
fi
echo ${email} | sed $'s/\'//g'
}
get_author_email