This is an automated email from the ASF dual-hosted git repository.

rec pushed a commit to branch UIMA-6419-Add-per-build-agent-override-parameter
in repository 
https://gitbox.apache.org/repos/asf/uima-build-jenkins-shared-library.git

commit 9635f1e9171b59162ed40645ca283586af351aea
Author: Richard Eckart de Castilho <[email protected]>
AuthorDate: Fri Feb 18 10:54:51 2022 +0100

    [UIMA-6419] Add per-build agent override parameter
    
    - Added agent override option
---
 vars/defaultPipeline.groovy | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/vars/defaultPipeline.groovy b/vars/defaultPipeline.groovy
index ac82d17..68a7f21 100644
--- a/vars/defaultPipeline.groovy
+++ b/vars/defaultPipeline.groovy
@@ -21,8 +21,19 @@ def call(body) {
   def config = createConfiguration(body)
     
   pipeline {
+    parameters {
+      string(
+        name: 'extraMavenArguments',
+        defaultValue: config.extraMavenArguments,
+        description: "Extra arguments to be passed to maven (for testing; 
overrides only current build)")
+      string(
+        name: 'agentLabel',
+        defaultValue: config.agentLabel,
+        description: "Eligible agents (in case a build keeps running on a 
broken agent; overrides only current build)")
+    }
+
     agent {
-      label config.agentLabel
+      label params.agentLabel ?: config.agentLabel
     }
   
     tools {
@@ -39,14 +50,7 @@ def call(body) {
       // Seems not to be working reliably yet: 
https://issues.jenkins-ci.org/browse/JENKINS-48556
       // timestamps()
     }
-    
-    parameters {
-      string(
-        name: 'extraMavenArguments',
-        defaultValue: config.extraMavenArguments,
-        description: "Extra arguments to be passed to maven (for testing; 
overrides only current build)")
-    }
-  
+      
     stages {
       // Display information about the build environemnt. This can be useful 
for debugging
       // build issues.

Reply via email to