I have a jenkins pipeline where I run my test cases. In the file attached there is a groovy syntax which automatically sends an email to me once the job is done with console output URL. But I want a coloured text saying weather my tests pass/failed in Green/Red color.
My Jenkins runs on Apache Tomcat server on windows!!
node ('linux') { try { stage('Checkout') { checkout scm } stage('Lint') { sh 'ant lint' } stage('Build') { sh 'ant composer.install' } stage('Code Analysis') { sh 'ant sonar' } stage('Deploy') { sh 'ant permissions.set' sh 'ant deploy' } } stage('Acceptance') { sh 'ant test.acceptance' notifySuccessful() } catch (e) { notifyFailed() throw e } } def notifyFailed() { hipchatSend (color: 'RED', notify: true, message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' ($ {env.BUILD_URL})" ) emailext ( subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", body: """
FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':