Last active
May 23, 2018 05:19
-
-
Save askalee/10fe9ef23d6f53312895851eea709d04 to your computer and use it in GitHub Desktop.
Dynamic parallel steps (Declarative Pipeline)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent { label "linux"} | |
stages { | |
stage('1') { | |
steps { | |
script { | |
def tests = [:] | |
for (f in ['a', 'b']) { | |
tests["${f}"] = { | |
node('linux') { | |
stage("${f}") { | |
def w = pwd() | |
echo "${f}: ${w}" | |
echo "workspace:${env.WORKSPACE}" | |
sh "./check.groovy" | |
} | |
} | |
} | |
} | |
parallel tests | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment