Change-Id: I8a3cc8c472c67c5dcd7e6b441919438bdc6eef06
Signed-off-by: madavi <jm00553988@techmahindra.com>
// error("${project} build ${build} failed")
}
}
// error("${project} build ${build} failed")
}
}
echo 'Exception in stage_1'
currentBuild.result = 'FAILURE'
}
finally {
echo 'Exception in stage_1'
currentBuild.result = 'FAILURE'
}
finally {
- if((${currentBuild.result} != 'SUCCESS') && (${env.JOB_NAME} == 'daily-stage_4')){
+ try {
+ if((currentBuild.result != 'SUCCESS') && (env.JOB_NAME == 'daily-stage_4')){
emailext (
subject: "[OSM-Jenkins] Job: ${env.JOB_NAME} Build: ${env.BUILD_NUMBER} Result: ${currentBuild.result}",
body: """ Check console output at "${env.BUILD_URL}" """,
emailext (
subject: "[OSM-Jenkins] Job: ${env.JOB_NAME} Build: ${env.BUILD_NUMBER} Result: ${currentBuild.result}",
body: """ Check console output at "${env.BUILD_URL}" """,
recipientProviders: [culprits()]
)
}
recipientProviders: [culprits()]
)
}
+ }
+ catch(caughtError) {
+ echo "Failure in executing email"
+ }
repo_base_url = "-u ${params.REPOSITORY_BASE}"
}
if ( params.DO_STAGE_4 ) {
repo_base_url = "-u ${params.REPOSITORY_BASE}"
}
if ( params.DO_STAGE_4 ) {
sh "docker stack list |grep \"${container_name_prefix}\"| awk '{ print \$1 }'| xargs docker stack rm"
sh "docker stack list |grep \"${container_name_prefix}\"| awk '{ print \$1 }'| xargs docker stack rm"
+ }
+ catch (caughtError) {
+ println("Caught error: docker stack rm failed!")
+ }
}
sh """
export PATH=$PATH:/snap/bin
}
sh """
export PATH=$PATH:/snap/bin