Why do you need to update an existing DSL job? If you already coded your jobs with DSL then you can edit them again to include your changes and run the seed job.
Bear in mind, you can configure the process job DSL build action to overwrite any existing jobs. Default action is doing nothing.
IMO if you do the above suggestions then you cans "update" any DSL jobs
I hope it helps
Cheers
import jenkins.model.*
import hudson.model.*
import hudson.slaves.*
slaves = ["slave1", "slave2", "slave3" ]
slaves.each {
if (! jenkins.instance.getNode(it)) {
jenkins.instance.addNode(new DumbSlave(it,
"Dummy slave, only generated once and you can edit it afterwards via WebUI",
"/home/jenkins/",
"1",
Node.Mode.NORMAL,
"test-slave-label",
new JNLPLauncher(),
new RetentionStrategy.Always(),
new LinkedList()))
} else {
println "It was already created"
}
}
job('example-1') {
steps {
slaves.each { slave ->
conditionalSteps {
condition {
stringsMatch('${SOME_PARAMETER}', "${slave}", false)
}
runner('Fail')
steps {
shell("echo 'just one step'")
}
}
}
}
}