Skip to content

Instantly share code, notes, and snippets.

@askalee
Last active May 23, 2018 05:19
Show Gist options
  • Save askalee/10fe9ef23d6f53312895851eea709d04 to your computer and use it in GitHub Desktop.
Save askalee/10fe9ef23d6f53312895851eea709d04 to your computer and use it in GitHub Desktop.
Dynamic parallel steps (Declarative Pipeline)
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