Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
Linux Master and Slaves
Description
Summary: When selecting multiple nodes for parallel execution, the values selected at build time cannot be properly retrieved from the environment variable.
Steps to reproduce:
1. Create a parameterized build that contains a Node parameter named HOSTS. 2. Select "Allow multi node selection for concurrent builds"
3. Checked the box further down to allow executing concurrent builds.
4. Create a system groovy script to print the values of the nodes selected. Here's the script:
import hudson.model.*
import hudson.util.*
def build = Thread.currentThread().executable
def resolver = build.buildVariableResolver
def chosenHosts = resolver.resolve("HOSTS")
println "HOSTS from System Groovy Script= " + chosenHosts
When I build I select 2 nodes from my list of available nodes( node1 and node2). It builds and executes on both nodes.
However the value of chosenHosts in the job that ran on node1 prints a value of node1
The job that executed on node2 prints a value of null.
What I expected was that the value of chosenHosts would be "node1, node2".
Note: This is in a system groovy script, so this build step is executing on the master.
Code changed in jenkins
User: imod
Path:
src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/wrapper/TriggerNextBuildWrapper.java
http://jenkins-ci.org/commit/nodelabelparameter-plugin/e35607a3b3c15023eb2b7306e15f7ed211139e4b
Log:
[FIXED JENKINS-15370] env variable not propagated for multiple job executions
Compare: https://github.com/jenkinsci/nodelabelparameter-plugin/compare/a0a1c3ee2790...e35607a3b3c1