Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kgonzago/a12b92d6b612191179564ce154b10a0b to your computer and use it in GitHub Desktop.
Save kgonzago/a12b92d6b612191179564ce154b10a0b to your computer and use it in GitHub Desktop.
Iterate across collection of machines
//Get all machines into an array
def machines = ["SolMeeSeeks01", "SolMeeSeeks02", "SolMeeSeeks03", "SolMeeSeeks04", "SolMeeSeeks05", "SolMeeSeeks06", "SolMeeSeeks07"]
//Iterate through machines
for (int i = 0; i < machines.size(); i++) {
node (machines[i]) {
stage ('Machine Name') {
bat 'hostname' //Placeholder command - call test runnner
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment