Signed-off-by: Wu Zhende wuzhende666@163.com --- lib/email.sh | 8 ++++++-- tests/self-test | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/lib/email.sh b/lib/email.sh index b5e56df79..99863aa1b 100755 --- a/lib/email.sh +++ b/lib/email.sh @@ -82,10 +82,14 @@ Compass-CI
selftest_content() { - email_content="To: $my_email + email_content="To: $recipient_email Subject: [NOTIFY Compass-CI] Self-test report
-Dear $my_name: +Dear $author_name and $commiter: + + commit_id: $commit_id + + commit_subject: $commit_subject
Your self-test groud_id=selftest job result is:
diff --git a/tests/self-test b/tests/self-test index fb3e87b17..11786ac3f 100755 --- a/tests/self-test +++ b/tests/self-test @@ -28,5 +28,23 @@ submit_job() log_info "selftest job result: $report_content" }
+get_commit_info() +{ + cd /c/compass-ci || exit + + commit_id=$(git log -1 --format="%H") + commit_subject=$(git log -1 --format="%s") + + author_name=$(git log -1 --format="%an") + author_email=$(git log -1 --format="%ae") + + commiter=$(git log -1 --format="%cn") + commiter_email=$(git log -1 --format="%ce") + + recipient_email="$author_email;$commiter_email" + +} + +get_commit_info submit_job send_email selftest