I am trying to figure out a way to have one list of parameters, and have Jenkins create a job or run a build for each of the items in the list.
The parameter is a directory, so I have a list of directories, and I want it to work so for each of them, the build runs several steps - so basically for each directory, run git pull, ant command, ant command, ant command with the directory name, publish test results, next build.
I have looked at a bunch of plugins but I can't figure out how to do this to get it to go to the next item in the list until they're all done.
if I understand correctly you have on job? You can trigger it multiple times with different parameters (directory) by using BuildFlow Plugin. Create build flow job and inside this job call your job with different parameters. In build flow job you can trigger your job with parameters
build("AntJob", parDirectory: "C:\src1")
build("AntJob", parDirectory: "C:\src2")
you can also create smarter DSL and run this job in parallel
def dirTable = [ "C:\src1", "C:\src2", "C:\src3"]
def builds = []
dirTable.each{ d ->
def clr = { build("AntJob", parDirectory: d) }
builds.add(clr)
}
parallel(builds)</code>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With