Fixing cord-onos-publisher jenkinsfile

Change-Id: I5dd672dc48c45c96346bd7367b2ae8dbe5f5fcd1
diff --git a/Jenkinsfile b/Jenkinsfile
index 80b322c..fc63265 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,9 +1,19 @@
 node ('ubuntu16.04-basebuild-1c-2g') {
-    stage 'Checkout code'
-    checkout([$class: 'RepoScm', currentBranch: true, manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true])
-
-    stage 'Build and Publish apps'
-    configFileProvider([configFile(fileId: 'onoscord-apps', variable: 'MAVEN_SETTINGS')]) {
-        sh 'export _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true && cd onos-apps/apps && mvn -s $MAVEN_SETTINGS clean deploy'
+  timeout (100) {
+    try {
+      stage 'Checkout code' {
+        checkout([$class: 'RepoScm', currentBranch: true, manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true])
+      }
+      stage 'Build and Publish apps' {
+        configFileProvider([configFile(fileId: 'onoscord-apps', variable: 'MAVEN_SETTINGS')]) {
+          sh 'export _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true && cd onos-apps/apps && mvn -s $MAVEN_SETTINGS clean deploy'
+        }
+      }
+      currentBuild.result = 'SUCCESS'
+    } catch (err) {
+      currentBuild.result = 'FAILURE'
+      step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
     }
+    echo "RESULT: ${currentBuild.result}"
+  }
 }