From ba453d4cbd4bfa5a21dbbac85066c5c334650bef Mon Sep 17 00:00:00 2001 From: Vitor Cardoso Date: Thu, 18 Jul 2024 12:17:54 +0100 Subject: [PATCH] [HNC-729] - QAT pipeline should honor SLAVE_NODE_LABEL property --- src/org/hitachivantara/ci/stages/ItemWorkStage.groovy | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/org/hitachivantara/ci/stages/ItemWorkStage.groovy b/src/org/hitachivantara/ci/stages/ItemWorkStage.groovy index ebae4a4..85c5356 100644 --- a/src/org/hitachivantara/ci/stages/ItemWorkStage.groovy +++ b/src/org/hitachivantara/ci/stages/ItemWorkStage.groovy @@ -13,6 +13,7 @@ import org.hitachivantara.ci.jenkins.MinionHandler import static org.hitachivantara.ci.config.LibraryProperties.BUILD_RETRIES import static org.hitachivantara.ci.config.LibraryProperties.IGNORE_PIPELINE_FAILURE import static org.hitachivantara.ci.config.LibraryProperties.OVERRIDE_PARAMS +import static org.hitachivantara.ci.config.LibraryProperties.SLAVE_NODE_LABEL class ItemWorkStage extends Stage { @@ -89,10 +90,14 @@ class ItemWorkStage extends Stage { // Minion call if (allowMinions && buildData.useMinions) { - execution = new JobBuild(MinionHandler.getFullJobName(item)) - .withParameters([ + Map minionParams = [ (OVERRIDE_PARAMS): "${MINION_STAGE}: ${id}" - ]) + ] + if (buildData.isSet(SLAVE_NODE_LABEL)) { + minionParams.put(SLAVE_NODE_LABEL, "${buildData.getString(SLAVE_NODE_LABEL)}") + } + execution = new JobBuild(MinionHandler.getFullJobName(item)) + .withParameters(minionParams) .getExecution() } // Local execution