From 7113f232142fcd8791d6c44db3b19db89f082695 Mon Sep 17 00:00:00 2001 From: Jenny Li Date: Thu, 9 Dec 2021 18:15:04 +0800 Subject: [PATCH] [skip ci] Update email (#13087) Signed-off-by: Jenny Li --- build/ci/jenkins/PR.groovy | 29 +++++++++++++++++------------ tests/scripts/get_author_email.sh | 11 +++++++++++ 2 files changed, 28 insertions(+), 12 deletions(-) create mode 100755 tests/scripts/get_author_email.sh diff --git a/build/ci/jenkins/PR.groovy b/build/ci/jenkins/PR.groovy index 7226ac310..8dae319d0 100644 --- a/build/ci/jenkins/PR.groovy +++ b/build/ci/jenkins/PR.groovy @@ -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" } } } } } - } -} +} \ No newline at end of file diff --git a/tests/scripts/get_author_email.sh b/tests/scripts/get_author_email.sh new file mode 100755 index 000000000..9937c24a0 --- /dev/null +++ b/tests/scripts/get_author_email.sh @@ -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 \ No newline at end of file -- GitLab