pipeline { agent any stages { stage('Test') { steps { sh "./gradlew clean test --info" } } } post { always { script { if (currentBuild.currentResult == 'FAILURE') { step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "a.romanov@ulstu.ru", sendToIndividuals: true]) } } } } }