Added 12h timeout to all pipelines

Change-Id: I085fcbda322d0877d5ffebd002fc109577788c29
diff --git a/build-debian-packages-jmx-exporter.groovy b/build-debian-packages-jmx-exporter.groovy
index 71f626e..d6e7fbd 100644
--- a/build-debian-packages-jmx-exporter.groovy
+++ b/build-debian-packages-jmx-exporter.groovy
@@ -5,73 +5,74 @@
 
 def timestamp = common.getDatetime()
 def javaversion = "8"
+timeout(time: 12, unit: 'HOURS') {
+    node('docker') {
+        try {
+            def img = dockerLib.getImage("tcpcloud/debian-build-ubuntu-${DIST}")
 
-node('docker') {
-    try {
-        def img = dockerLib.getImage("tcpcloud/debian-build-ubuntu-${DIST}")
-
-        if ("${DIST}" == "trusty") {
-        	javaversion = "7"
-        }
-
-        img.inside ("-u root:root") {
-            sh("rm -rf * || true")
-        }
-
-        stage("checkout") {
-            git.checkoutGitRepository(
-                "jmx-exporter-${timestamp}",
-                "${SOURCE_URL}",
-                SOURCE_BRANCH,
-                SOURCE_CREDENTIALS,
-                true,
-                30,
-                1
-            )
-        }
-
-        img.inside ("-u root:root") {
-            stage("Build") {
-                sh("sed -i \"s/TIMESTAMP/${timestamp}/g\" \$(find ./ -name pom.xml)")
-                sh("sudo apt-get update && sudo apt-get install -y openjdk-${javaversion}-jdk maven")
-                sh("cd jmx-exporter-${timestamp} && mvn package")
+            if ("${DIST}" == "trusty") {
+            	javaversion = "7"
             }
-        }
 
-        if (UPLOAD_APTLY.toBoolean()) {
-            stage("upload package") {
-                def buildSteps = [:]
-                def debFiles = sh script: "find ./ -name *.deb", returnStdout: true
-                def debFilesArray = debFiles.trim().tokenize()
-                def workspace = common.getWorkspace()
-                for (int i = 0; i < debFilesArray.size(); i++) {
-                    def debFile = debFilesArray[i];
-                    buildSteps[debFiles[i]] = aptly.uploadPackageStep(
-                        "${workspace}/"+debFile,
-                        APTLY_URL,
-                        APTLY_REPO,
-                        true
-                    )
+            img.inside ("-u root:root") {
+                sh("rm -rf * || true")
+            }
+
+            stage("checkout") {
+                git.checkoutGitRepository(
+                    "jmx-exporter-${timestamp}",
+                    "${SOURCE_URL}",
+                    SOURCE_BRANCH,
+                    SOURCE_CREDENTIALS,
+                    true,
+                    30,
+                    1
+                )
+            }
+
+            img.inside ("-u root:root") {
+                stage("Build") {
+                    sh("sed -i \"s/TIMESTAMP/${timestamp}/g\" \$(find ./ -name pom.xml)")
+                    sh("sudo apt-get update && sudo apt-get install -y openjdk-${javaversion}-jdk maven")
+                    sh("cd jmx-exporter-${timestamp} && mvn package")
                 }
-                parallel buildSteps
             }
 
-            stage("publish") {
-                aptly.snapshotRepo(APTLY_URL, APTLY_REPO, timestamp)
-                aptly.publish(APTLY_URL)
+            if (UPLOAD_APTLY.toBoolean()) {
+                stage("upload package") {
+                    def buildSteps = [:]
+                    def debFiles = sh script: "find ./ -name *.deb", returnStdout: true
+                    def debFilesArray = debFiles.trim().tokenize()
+                    def workspace = common.getWorkspace()
+                    for (int i = 0; i < debFilesArray.size(); i++) {
+                        def debFile = debFilesArray[i];
+                        buildSteps[debFiles[i]] = aptly.uploadPackageStep(
+                            "${workspace}/"+debFile,
+                            APTLY_URL,
+                            APTLY_REPO,
+                            true
+                        )
+                    }
+                    parallel buildSteps
+                }
+
+                stage("publish") {
+                    aptly.snapshotRepo(APTLY_URL, APTLY_REPO, timestamp)
+                    aptly.publish(APTLY_URL)
+                }
             }
-        }
 
-        img.inside ("-u root:root") {
-            sh("rm -rf * || true")
-        }
+            img.inside ("-u root:root") {
+                sh("rm -rf * || true")
+            }
 
-    } catch (Throwable e) {
-       // If there was an exception thrown, the build failed
-       currentBuild.result = "FAILURE"
-       currentBuild.description = currentBuild.description ? e.message + " " + currentBuild.description : e.message
-       throw e
-    } finally {
-       common.sendNotification(currentBuild.result,"",["slack"])
+        } catch (Throwable e) {
+           // If there was an exception thrown, the build failed
+           currentBuild.result = "FAILURE"
+           currentBuild.description = currentBuild.description ? e.message + " " + currentBuild.description : e.message
+           throw e
+        } finally {
+           common.sendNotification(currentBuild.result,"",["slack"])
+        }
     }
 }