Added 12h timeout to all pipelines

Change-Id: I085fcbda322d0877d5ffebd002fc109577788c29
diff --git a/change-config.groovy b/change-config.groovy
index 0b4538c..35cc99f 100644
--- a/change-config.groovy
+++ b/change-config.groovy
@@ -24,79 +24,80 @@
 def minions
 def result
 def states
+timeout(time: 12, unit: 'HOURS') {
+    node() {
+        try {
 
-node() {
-    try {
-
-        if (TARGET_STATES != "") {
-            states = TARGET_STATES
-        }
-        else {
-            states = null
-        }
-
-        stage('Setup virtualenv for Pepper') {
-            python.setupPepperVirtualenv(pepperEnv, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
-        }
-
-        if (common.validInputParam("PULL_MODEL") && PULL_MODEL.toBoolean() == true) {
-            stage('Update the reclass cluster model') {
-                def saltMasterTarget = ['expression': 'I@salt:master', 'type': 'compound']
-                result = salt.runSaltCommand(pepperEnv, 'local', saltMasterTarget, 'state.apply', null, "reclass.storage.data")
-                salt.checkResult(result)
-            }
-        }
-
-        stage('List target servers') {
-            minions = salt.getMinions(pepperEnv, TARGET_SERVERS)
-            if (minions.isEmpty()) {
-                throw new Exception("No minion was targeted")
-            }
-            if (TARGET_SUBSET_TEST != "") {
-                targetTestSubset = ['expression': minions.subList(0, Integer.valueOf(TARGET_SUBSET_TEST)).join(' or '), 'type': 'compound']
+            if (TARGET_STATES != "") {
+                states = TARGET_STATES
             }
             else {
-                targetTestSubset = ['expression': minions.join(' or '), 'type': 'compound']
+                states = null
             }
-            targetLiveSubset = ['expression': minions.subList(0, Integer.valueOf(TARGET_SUBSET_LIVE)).join(' or '), 'type': 'compound']
-            targetLiveAll = ['expression': minions.join(' or '), 'type': 'compound']
-            common.infoMsg("Found nodes: ${targetLiveAll.expression}")
-            common.infoMsg("Selected test nodes: ${targetTestSubset.expression}")
-            common.infoMsg("Selected sample nodes: ${targetLiveSubset.expression}")
-        }
 
-        stage('Test config changes') {
-            def kwargs = [
-                'test': true
-            ]
-            result = salt.runSaltCommand(pepperEnv, 'local', targetTestSubset, 'state.apply', null, states, kwargs)
-            salt.checkResult(result)
-        }
-
-        stage('Confirm live changes on sample') {
-            timeout(time: 2, unit: 'HOURS') {
-               input message: "Approve live config change on ${targetLiveSubset.expression} nodes?"
+            stage('Setup virtualenv for Pepper') {
+                python.setupPepperVirtualenv(pepperEnv, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
             }
-        }
 
-        stage('Apply config changes on sample') {
-            result = salt.runSaltCommand(pepperEnv, 'local', targetLiveSubset, 'state.apply', null, states)
-            salt.checkResult(result)
-        }
-
-        stage('Confirm live changes on all nodes') {
-            timeout(time: 2, unit: 'HOURS') {
-               input message: "Approve live config change on ${targetLiveAll.expression} nodes?"
+            if (common.validInputParam("PULL_MODEL") && PULL_MODEL.toBoolean() == true) {
+                stage('Update the reclass cluster model') {
+                    def saltMasterTarget = ['expression': 'I@salt:master', 'type': 'compound']
+                    result = salt.runSaltCommand(pepperEnv, 'local', saltMasterTarget, 'state.apply', null, "reclass.storage.data")
+                    salt.checkResult(result)
+                }
             }
-        }
 
-        stage('Apply config changes on all nodes') {
-            result = salt.runSaltCommand(pepperEnv, 'local', targetLiveAll, 'state.apply', null, states)
-            salt.checkResult(result)
-        }
+            stage('List target servers') {
+                minions = salt.getMinions(pepperEnv, TARGET_SERVERS)
+                if (minions.isEmpty()) {
+                    throw new Exception("No minion was targeted")
+                }
+                if (TARGET_SUBSET_TEST != "") {
+                    targetTestSubset = ['expression': minions.subList(0, Integer.valueOf(TARGET_SUBSET_TEST)).join(' or '), 'type': 'compound']
+                }
+                else {
+                    targetTestSubset = ['expression': minions.join(' or '), 'type': 'compound']
+                }
+                targetLiveSubset = ['expression': minions.subList(0, Integer.valueOf(TARGET_SUBSET_LIVE)).join(' or '), 'type': 'compound']
+                targetLiveAll = ['expression': minions.join(' or '), 'type': 'compound']
+                common.infoMsg("Found nodes: ${targetLiveAll.expression}")
+                common.infoMsg("Selected test nodes: ${targetTestSubset.expression}")
+                common.infoMsg("Selected sample nodes: ${targetLiveSubset.expression}")
+            }
 
-    } catch (Throwable e) {
-        currentBuild.result = 'FAILURE'
-        throw e
+            stage('Test config changes') {
+                def kwargs = [
+                    'test': true
+                ]
+                result = salt.runSaltCommand(pepperEnv, 'local', targetTestSubset, 'state.apply', null, states, kwargs)
+                salt.checkResult(result)
+            }
+
+            stage('Confirm live changes on sample') {
+                timeout(time: 2, unit: 'HOURS') {
+                   input message: "Approve live config change on ${targetLiveSubset.expression} nodes?"
+                }
+            }
+
+            stage('Apply config changes on sample') {
+                result = salt.runSaltCommand(pepperEnv, 'local', targetLiveSubset, 'state.apply', null, states)
+                salt.checkResult(result)
+            }
+
+            stage('Confirm live changes on all nodes') {
+                timeout(time: 2, unit: 'HOURS') {
+                   input message: "Approve live config change on ${targetLiveAll.expression} nodes?"
+                }
+            }
+
+            stage('Apply config changes on all nodes') {
+                result = salt.runSaltCommand(pepperEnv, 'local', targetLiveAll, 'state.apply', null, states)
+                salt.checkResult(result)
+            }
+
+        } catch (Throwable e) {
+            currentBuild.result = 'FAILURE'
+            throw e
+        }
     }
 }