i have munit html report and integration html report. if in case there is any failure in integration test so report is not generated. and i want to send email notification to only munit test but not integration test. so i tried if condition but i am clueless how to fit double if condition in post action.
it will be really helpful if anyone suggest me a way to solve the above scenario. and i have defined below variables but facing issue with exit variable.
FILE = "${DEMO}/${BUILD_NUMBER}/MunitReport-${BUILD_NUMBER}.html"
def exists = fileExists 'FILE'
REPO = "${DEMO}/${BUILD_NUMBER}/report/${BUILD_NUMBER}/htmlreport.html"
def exit = fileExists 'REPO'
error:groovy.lang.MissingPropertyException: No such property: exist for class: groovy.lang.Binding at groovy.lang.Binding.getVariable(Binding.java:63)
post {
always{
script{
if ((exists))
emailext attachLog: true, body: "${currentBuild.result}: <h4> MUnit test Results from Below link</h4> <h3>****/job/*****job/********/job/master/${BUILD_NUMBER}/Munit_20Report</h3> <h4>Integration test Results from Below link</h4> <h3>*********/job/********/job/*******/job/master/${BUILD_NUMBER}/Integration_20Test_20Report</h3>"", compressLog: true, replyTo: 'email@xxx.com',
subject: "Build Notification: ${JOB_NAME}-Build# ${BUILD_NUMBER} ${currentBuild.result}", to: 'email123@xxx.com'
thanks in advance