def get_dummy_params(val) { return [string(name: 'dummy', value: "$val")] } def create_jobs() { def jobs = [:] for (int i=1; i <= 3; i++) { def x = i jobs["job-$x"] = { -> build([job: "job-$x", parameters: get_dummy_params(x) ]) } } return jobs } stage ('triggering') { parallel(create_jobs()) }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter