<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/12701">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">CI: Add "throttle" label and "skip_gate" capability<br><br>To make throttling by label fully active, the "throttle" option<br>has to be specified with a specific label.<br><br>You can now specify "skip_gate" in the Gerrit comments when you<br>do a +2 code review to tell Jenkins not to actually run the<br>gate. You'd do this if you plan to manually merge the change.<br><br>Also updated the "printenv" debug output to better sort multi-line<br>comments.<br><br>Change-Id: I4c0b1085acec4805f2ca207eebac50aad81f27e2<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, 19 insertions(+), 10 deletions(-)<br><br></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 359dbbe..219abb0 100644</span><br><span>--- a/tests/CI/gates.jenkinsfile</span><br><span>+++ b/tests/CI/gates.jenkinsfile</span><br><span>@@ -20,6 +20,8 @@</span><br><span> </span><br><span> pipeline {</span><br><span> options {</span><br><span style="color: hsl(120, 100%, 40%);">+ ansiColor('gnome-terminal')</span><br><span style="color: hsl(120, 100%, 40%);">+ throttle(['asterisk-gate'])</span><br><span> timestamps()</span><br><span> timeout(time: timeoutTime, unit: timeoutUnits)</span><br><span> }</span><br><span>@@ -62,14 +64,15 @@</span><br><span> </span><br><span> stages {</span><br><span> stage ("->") {</span><br><span style="color: hsl(0, 100%, 40%);">- /*</span><br><span style="color: hsl(0, 100%, 40%);">- * Jenkins will try to automatically rebuild this job when</span><br><span style="color: hsl(0, 100%, 40%);">- * the jenkinsfile changes but since this job is dependent on</span><br><span style="color: hsl(0, 100%, 40%);">- * Gerrit, we really don't want to do anything in that case.</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span> when {</span><br><span style="color: hsl(120, 100%, 40%);">+ /*</span><br><span style="color: hsl(120, 100%, 40%);">+ * Jenkins will try to automatically rebuild this job when</span><br><span style="color: hsl(120, 100%, 40%);">+ * the jenkinsfile changes but since this job is dependent on</span><br><span style="color: hsl(120, 100%, 40%);">+ * Gerrit, we really don't want to do anything in that case.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span> not { environment name: 'GERRIT_CHANGE_NUMBER', value: '' }</span><br><span style="color: hsl(0, 100%, 40%);">- not { environment name: 'GERRIT_EVENT_ACCOUNT_NAME', value: 'Jenkins2' }</span><br><span style="color: hsl(120, 100%, 40%);">+ /* If "skip_gate" is in the comments, don't run the job */</span><br><span style="color: hsl(120, 100%, 40%);">+ not { expression { env.GERRIT_EVENT_COMMENT_TEXT ==~ /.*skip_gate.*/ } }</span><br><span> }</span><br><span> steps {</span><br><span> /* Here's where we switch to scripted pipeline */</span><br><span>@@ -97,7 +100,7 @@</span><br><span> withCredentials([usernamePassword(credentialsId: "${JENKINS_GERRIT_CREDS}",</span><br><span> passwordVariable: 'GERRIT_USER_PW', usernameVariable: 'GERRIT_USER_NAME')]) {</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- sh "printenv | sort"</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "printenv -0 | sort -z | tr '\0' '\n'"</span><br><span> </span><br><span> checkout scm: [$class: 'GitSCM',</span><br><span> branches: [[name: env.GERRIT_BRANCH ]],</span><br><span>diff --git a/tests/CI/periodics-daily.jenkinsfile b/tests/CI/periodics-daily.jenkinsfile</span><br><span>index c91c5e5..ce10209 100644</span><br><span>--- a/tests/CI/periodics-daily.jenkinsfile</span><br><span>+++ b/tests/CI/periodics-daily.jenkinsfile</span><br><span>@@ -20,6 +20,8 @@</span><br><span> </span><br><span> pipeline {</span><br><span> options {</span><br><span style="color: hsl(120, 100%, 40%);">+ ansiColor('gnome-terminal')</span><br><span style="color: hsl(120, 100%, 40%);">+ throttle(['asterisk-daily'])</span><br><span> timestamps()</span><br><span> timeout(time: timeoutTime, unit: timeoutUnits)</span><br><span> }</span><br><span>@@ -41,7 +43,7 @@</span><br><span> </span><br><span> stage ("Checkout") {</span><br><span> sh "sudo chown -R jenkins:users ."</span><br><span style="color: hsl(0, 100%, 40%);">- sh "printenv | sort"</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "printenv -0 | sort -z | tr '\0' '\n'"</span><br><span> sh "sudo tests/CI/setupJenkinsEnvironment.sh"</span><br><span> }</span><br><span> </span><br><span>diff --git a/tests/CI/ref_debug.jenkinsfile b/tests/CI/ref_debug.jenkinsfile</span><br><span>index 0d1e522..5c4f487 100644</span><br><span>--- a/tests/CI/ref_debug.jenkinsfile</span><br><span>+++ b/tests/CI/ref_debug.jenkinsfile</span><br><span>@@ -20,6 +20,8 @@</span><br><span> </span><br><span> pipeline {</span><br><span> options {</span><br><span style="color: hsl(120, 100%, 40%);">+ ansiColor('gnome-terminal')</span><br><span style="color: hsl(120, 100%, 40%);">+ throttle(['asterisk-ref-debug'])</span><br><span> timestamps()</span><br><span> timeout(time: timeoutTime, unit: timeoutUnits)</span><br><span> }</span><br><span>@@ -41,7 +43,7 @@</span><br><span> </span><br><span> stage ("Checkout") {</span><br><span> sh "sudo chown -R jenkins:users ."</span><br><span style="color: hsl(0, 100%, 40%);">- sh "printenv | sort"</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "printenv -0 | sort -z | tr '\0' '\n'"</span><br><span> sh "sudo tests/CI/setupJenkinsEnvironment.sh"</span><br><span> }</span><br><span> </span><br><span>diff --git a/tests/CI/unittests.jenkinsfile b/tests/CI/unittests.jenkinsfile</span><br><span>index 97d18a8..7a5cd4a 100644</span><br><span>--- a/tests/CI/unittests.jenkinsfile</span><br><span>+++ b/tests/CI/unittests.jenkinsfile</span><br><span>@@ -20,6 +20,8 @@</span><br><span> </span><br><span> pipeline {</span><br><span> options {</span><br><span style="color: hsl(120, 100%, 40%);">+ ansiColor('gnome-terminal')</span><br><span style="color: hsl(120, 100%, 40%);">+ throttle(['asterisk-check'])</span><br><span> timestamps()</span><br><span> timeout(time: timeoutTime, unit: timeoutUnits)</span><br><span> }</span><br><span>@@ -98,7 +100,7 @@</span><br><span> withCredentials([usernamePassword(credentialsId: "${JENKINS_GERRIT_CREDS}",</span><br><span> passwordVariable: 'GERRIT_USER_PW', usernameVariable: 'GERRIT_USER_NAME')]) {</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- sh "printenv | sort"</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "printenv -0 | sort -z | tr '\0' '\n'"</span><br><span> </span><br><span> checkout scm: [$class: 'GitSCM',</span><br><span> branches: [[name: env.GERRIT_BRANCH ]],</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/12701">change 12701</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/c/asterisk/+/12701"/><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-Change-Id: I4c0b1085acec4805f2ca207eebac50aad81f27e2 </div>
<div style="display:none"> Gerrit-Change-Number: 12701 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>