How to send mail notification about build failure in jenkins.. with example

Поделиться
HTML-код
  • Опубликовано: 27 янв 2025
  • Here I have used,
    Plugin: Jenkins Mailer Plugin
    Mail: Gmail
    Code to be added in your Jenkinsfile:
    post {
    failure {
    echo 'sending email notification from jenkins'
    step([$class: 'Mailer',
    notifyEveryUnstableBuild: true,
    recipients: emailextrecipients([[$class: 'CulpritsRecipientProvider'],
    [$class: 'RequesterRecipientProvider']])])
    }

Комментарии •