I'm a noob to the groovy and came across the job-dsl Jenkins plugin which suits my requirement.
My requirement is to replicate the existing Jenkins Job (say A) and create a new job B with only change as subversion URL (in the subversion plugin) in the Job B.
I tried out developing a basic job-dsl script like below and develop further from there that suits my aforementioned requirement.
job('ci') {
description 'Build and test the app.'
scm {
svn('https://svn.mydomain.com/repo/project1/trunk')
}
}
Below is the issue Im facing, I tried figuring out the answer without any luck and would be really grateful for any help.
Using dsl from string
ERROR: Build step failed with exception
groovy.lang.MissingMethodException: No signature of method: Script1.job() is applicable for argument types: (java.lang.String, Script1$_run_closure1) values: [PROJ-unit-tests, Script1$_run_closure1@199fab4]
Possible solutions: job(groovy.lang.Closure), run(), run(), any(), wait(), dump()