Skip to content

Commit 55fec53

Browse files
author
R. Tyler Croy
authored
Merge pull request jenkinsci#39 from omehegan/master
Add an example of how to parallel builds on multiple nodes
2 parents aa0337c + 7607dfa commit 55fec53

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
def labels = ['precise', 'trusty'] // labels for Jenkins node types we will build on
2+
def builders = [:]
3+
for (x in labels) {
4+
def label = x // Need to bind the label variable before the closure - can't do 'for (label in labels)'
5+
6+
// Create a map to pass in to the 'parallel' step so we can fire all the builds at once
7+
builders[label] = {
8+
node(label) {
9+
// build steps that should happen on all nodes go here
10+
}
11+
}
12+
}
13+
14+
parallel builders
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Synopsis
2+
3+
This is a simple example showing how to succinctly parallel the same build across multiple Jenkins nodes. This is useful for e.g. building the same project on multiple OS platforms.

0 commit comments

Comments
 (0)