<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10692">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">CI: Get job timeouts from environment<br><br>The job timeouts were hard coded in the jenkinsfiles which<br>means changes had to go through gerrit. Now they are taken<br>from the following environment variables (and their defaults) that<br>can be set in Jenkins configuration...<br><br>TIMEOUT_GATES = "60 MINUTES"<br>TIMEOUT_DAILIES = "3 HOURS"<br>TIMEOUT_REF_DEBUG = "24 HOURS"<br>TIMEOUT_UNITTESTS = "30 MINUTES"<br><br>Change-Id: I673a551c1780bf665a3bc160b245da574aa4bbab<br>---<br>M tests/CI/gates.jenkinsfile<br>M tests/CI/periodics-daily.jenkinsfile<br>M tests/CI/ref_debug.jenkinsfile<br>M tests/CI/unittests.jenkinsfile<br>4 files changed, 36 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/92/10692/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/CI/gates.jenkinsfile b/tests/CI/gates.jenkinsfile</span><br><span>index 1839a8b..ede3353 100644</span><br><span>--- a/tests/CI/gates.jenkinsfile</span><br><span>+++ b/tests/CI/gates.jenkinsfile</span><br><span>@@ -10,10 +10,18 @@</span><br><span> * we need to dynamically determine which docker image we're going to use and</span><br><span> * you can't do that in a delcarative pipeline.</span><br><span> */</span><br><span style="color: hsl(120, 100%, 40%);">+def timeoutTime = 60</span><br><span style="color: hsl(120, 100%, 40%);">+def timeoutUnits = 'MINUTES'</span><br><span style="color: hsl(120, 100%, 40%);">+if (env.TIMEOUT_GATES) {</span><br><span style="color: hsl(120, 100%, 40%);">+ def _timeout = env.TIMEOUT_GATES.split()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeoutTime = _timeout[0].toInteger()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeoutUnits = _timeout[1]</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> pipeline {</span><br><span> options {</span><br><span> timestamps()</span><br><span style="color: hsl(0, 100%, 40%);">- timeout(time: 60, unit: 'MINUTES')</span><br><span style="color: hsl(120, 100%, 40%);">+ timeout(time: timeoutTime, unit: timeoutUnits)</span><br><span> }</span><br><span> triggers {</span><br><span> /*</span><br><span>diff --git a/tests/CI/periodics-daily.jenkinsfile b/tests/CI/periodics-daily.jenkinsfile</span><br><span>index ba56665..26c9db9 100644</span><br><span>--- a/tests/CI/periodics-daily.jenkinsfile</span><br><span>+++ b/tests/CI/periodics-daily.jenkinsfile</span><br><span>@@ -10,10 +10,18 @@</span><br><span> * we need to dynamically determine which docker image we're going to use and</span><br><span> * you can't do that in a delcarative pipeline.</span><br><span> */</span><br><span style="color: hsl(120, 100%, 40%);">+def timeoutTime = 3</span><br><span style="color: hsl(120, 100%, 40%);">+def timeoutUnits = 'HOURS'</span><br><span style="color: hsl(120, 100%, 40%);">+if (env.TIMEOUT_DAILIES) {</span><br><span style="color: hsl(120, 100%, 40%);">+ def _timeout = env.TIMEOUT_DAILIES.split()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeoutTime = _timeout[0].toInteger()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeoutUnits = _timeout[1]</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> pipeline {</span><br><span> options {</span><br><span> timestamps()</span><br><span style="color: hsl(0, 100%, 40%);">- timeout(time: 3, unit: 'HOURS')</span><br><span style="color: hsl(120, 100%, 40%);">+ timeout(time: timeoutTime, unit: timeoutUnits)</span><br><span> }</span><br><span> triggers {</span><br><span> cron 'H H(0-4) * * *'</span><br><span>diff --git a/tests/CI/ref_debug.jenkinsfile b/tests/CI/ref_debug.jenkinsfile</span><br><span>index 2c6daf0..f991349 100644</span><br><span>--- a/tests/CI/ref_debug.jenkinsfile</span><br><span>+++ b/tests/CI/ref_debug.jenkinsfile</span><br><span>@@ -10,10 +10,18 @@</span><br><span> * we need to dynamically determine which docker image we're going to use and</span><br><span> * you can't do that in a delcarative pipeline.</span><br><span> */</span><br><span style="color: hsl(120, 100%, 40%);">+def timeoutTime = 24</span><br><span style="color: hsl(120, 100%, 40%);">+def timeoutUnits = 'HOURS'</span><br><span style="color: hsl(120, 100%, 40%);">+if (env.TIMEOUT_REF_DEBUG) {</span><br><span style="color: hsl(120, 100%, 40%);">+ def _timeout = env.TIMEOUT_REF_DEBUG.split()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeoutTime = _timeout[0].toInteger()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeoutUnits = _timeout[1]</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> pipeline {</span><br><span> options {</span><br><span> timestamps()</span><br><span style="color: hsl(0, 100%, 40%);">- timeout(time: 1, unit: 'DAYS')</span><br><span style="color: hsl(120, 100%, 40%);">+ timeout(time: timeoutTime, unit: timeoutUnits)</span><br><span> }</span><br><span> triggers {</span><br><span> cron 'H H(0-4) * * 0'</span><br><span>diff --git a/tests/CI/unittests.jenkinsfile b/tests/CI/unittests.jenkinsfile</span><br><span>index 61dac70..2916cb4 100644</span><br><span>--- a/tests/CI/unittests.jenkinsfile</span><br><span>+++ b/tests/CI/unittests.jenkinsfile</span><br><span>@@ -10,10 +10,18 @@</span><br><span> * we need to dynamically determine which docker image we're going to use and</span><br><span> * you can't do that in a delcarative pipeline.</span><br><span> */</span><br><span style="color: hsl(120, 100%, 40%);">+def timeoutTime = 30</span><br><span style="color: hsl(120, 100%, 40%);">+def timeoutUnits = 'MINUTES'</span><br><span style="color: hsl(120, 100%, 40%);">+if (env.TIMEOUT_UNITTESTS) {</span><br><span style="color: hsl(120, 100%, 40%);">+ def _timeout = env.TIMEOUT_UNITTESTS.split()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeoutTime = _timeout[0].toInteger()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeoutUnits = _timeout[1]</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> pipeline {</span><br><span> options {</span><br><span> timestamps()</span><br><span style="color: hsl(0, 100%, 40%);">- timeout(time: 30, unit: 'MINUTES')</span><br><span style="color: hsl(120, 100%, 40%);">+ timeout(time: timeoutTime, unit: timeoutUnits)</span><br><span> }</span><br><span> triggers {</span><br><span> /*</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10692">change 10692</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10692"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I673a551c1780bf665a3bc160b245da574aa4bbab </div>
<div style="display:none"> Gerrit-Change-Number: 10692 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>