]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
CI: Get job timeouts from environment
authorGeorge Joseph <gjoseph@digium.com>
Mon, 19 Nov 2018 17:59:07 +0000 (10:59 -0700)
committerGeorge Joseph <gjoseph@digium.com>
Mon, 19 Nov 2018 17:59:07 +0000 (10:59 -0700)
The job timeouts were hard coded in the jenkinsfiles which
means changes had to go through gerrit.  Now they are taken
from the following environment variables (and their defaults) that
can be set in Jenkins configuration...

TIMEOUT_GATES =      "60 MINUTES"
TIMEOUT_DAILIES =    "3 HOURS"
TIMEOUT_REF_DEBUG =  "24 HOURS"
TIMEOUT_UNITTESTS =  "30 MINUTES"

Change-Id: I673a551c1780bf665a3bc160b245da574aa4bbab

tests/CI/gates.jenkinsfile
tests/CI/periodics-daily.jenkinsfile
tests/CI/ref_debug.jenkinsfile
tests/CI/unittests.jenkinsfile

index 1839a8b79ef2f3b5dff49508731deb5db7bcad0c..ede335392b968c4c69063bb4020db5939b183d0a 100644 (file)
  * we need to dynamically determine which docker image we're going to use and
  * you can't do that in a delcarative pipeline.
  */
+def timeoutTime = 60
+def timeoutUnits = 'MINUTES'
+if (env.TIMEOUT_GATES) {
+       def _timeout = env.TIMEOUT_GATES.split()
+       timeoutTime = _timeout[0].toInteger()
+       timeoutUnits = _timeout[1]
+}
+
 pipeline {
        options {
                timestamps()
-               timeout(time: 60, unit: 'MINUTES')
+               timeout(time: timeoutTime, unit: timeoutUnits)
        }
        triggers {
                /*
index ba56665059c16d09ee3ffd6812885c1d99ec8c28..26c9db9a2155e74b30df90af9f99a36c2d3b7945 100644 (file)
  * we need to dynamically determine which docker image we're going to use and
  * you can't do that in a delcarative pipeline.
  */
+def timeoutTime = 3
+def timeoutUnits = 'HOURS'
+if (env.TIMEOUT_DAILIES) {
+       def _timeout = env.TIMEOUT_DAILIES.split()
+       timeoutTime = _timeout[0].toInteger()
+       timeoutUnits = _timeout[1]
+}
+
 pipeline {
        options {
                timestamps()
-               timeout(time: 3, unit: 'HOURS')
+               timeout(time: timeoutTime, unit: timeoutUnits)
        }
        triggers {
                cron 'H H(0-4) * * *'
index 2c6daf069b9c2a1554c238566334932a2b135116..f991349737bb37008f0130e49351179db9409349 100644 (file)
  * we need to dynamically determine which docker image we're going to use and
  * you can't do that in a delcarative pipeline.
  */
+def timeoutTime = 24
+def timeoutUnits = 'HOURS'
+if (env.TIMEOUT_REF_DEBUG) {
+       def _timeout = env.TIMEOUT_REF_DEBUG.split()
+       timeoutTime = _timeout[0].toInteger()
+       timeoutUnits = _timeout[1]
+}
+
 pipeline {
        options {
                timestamps()
-               timeout(time: 1, unit: 'DAYS')
+               timeout(time: timeoutTime, unit: timeoutUnits)
        }
        triggers {
                cron 'H H(0-4) * * 0'
index 61dac7002e864a7b7861d48388b7c2663298de0b..2916cb4ee775c9be19eb1f0e0ead10c7942c2c17 100644 (file)
  * we need to dynamically determine which docker image we're going to use and
  * you can't do that in a delcarative pipeline.
  */
+def timeoutTime = 30
+def timeoutUnits = 'MINUTES'
+if (env.TIMEOUT_UNITTESTS) {
+       def _timeout = env.TIMEOUT_UNITTESTS.split()
+       timeoutTime = _timeout[0].toInteger()
+       timeoutUnits = _timeout[1]
+}
+
 pipeline {
        options {
                timestamps()
-               timeout(time: 30, unit: 'MINUTES')
+               timeout(time: timeoutTime, unit: timeoutUnits)
        }
        triggers {
                /*