From 91201a4b58f2747b9e18ab288718a9d25e89533c Mon Sep 17 00:00:00 2001 From: abhishek Date: Wed, 1 Nov 2023 12:52:11 +0530 Subject: [PATCH] added email notification steps --- Jenkinsfile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 961d35c44..69acc55a1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,9 +17,22 @@ pipeline{ steps{ withSonarQubeEnv('SONAR_CLOUD'){ sh 'mvn clean verify sonar:sonar -Dsonar.organization=springgit -Dsonar.projectKey=springgit' - } - + } } } } + post{ + success{ + mail subject : 'Jenkins job of ${JOB_NAME} of build numer ${BUILD_ID} is passed', + body : 'Click Here to see more details ${BUILD_URL}', + from : 'jenkins@outlook.com' + to : 'abhishek16tiwary@gmail.com' + } + failure{ + mail subject : 'Jenkins job of ${JOB_NAME} of build numer ${BUILD_ID} is Failed', + body : 'Click Here to see more details ${BUILD_URL}', + from : 'jenkins@outlook.com' + to : 'abhishek16tiwary@gmail.com' + } + } } \ No newline at end of file