Skip to content

Commit 7607dfa

Browse files
author
Owen Mehegan
committed
Add a comment explaining the variable binding
1 parent d672eea commit 7607dfa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pipeline-examples/parallel-multiple-nodes/ParallelMultipleNodes.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
def labels = ['precise', 'trusty'] // labels for Jenkins node types we will build on
22
def builders = [:]
33
for (x in labels) {
4-
def label = x
4+
def label = x // Need to bind the label variable before the closure - can't do 'for (label in labels)'
5+
56
// Create a map to pass in to the 'parallel' step so we can fire all the builds at once
67
builders[label] = {
78
node(label) {

0 commit comments

Comments
 (0)