From c8eb68d556180221583b397f475e3495475f3b2e Mon Sep 17 00:00:00 2001
From: Raphael Defosseux <raphael.defosseux@eurecom.fr>
Date: Thu, 6 Sep 2018 12:21:34 +0200
Subject: [PATCH] CI: adding email notification w/ HTML reports in attachment

Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
---
 ci-scripts/Jenkinsfile-gitlab | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab
index 783612c13b..7019d13124 100644
--- a/ci-scripts/Jenkinsfile-gitlab
+++ b/ci-scripts/Jenkinsfile-gitlab
@@ -395,6 +395,15 @@ pipeline {
             script {
                 // Stage destroy may not be run if error in previous stage
                 sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
+                emailext attachmentsPattern: '*results*.html',
+                     body: '''Hi,
+Here are attached HTML report files for $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!
+
+Regards,
+OAI CI Team''',
+                     replyTo: 'no-reply@openairinterface.org',
+                     subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!',
+                     to: env.gitlabUserEmail
             }
         }
         success {
-- 
GitLab