Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fix Subversion plugin configuration in Jenkins in all jobs
// Modify SVN related in memory objects
for(item in Hudson.instance.items) {
def scm = item.scm
if((scm instanceof org.jenkinsci.plugins.multiplescms.MultiSCM) ) {
println('##########')
for(s in scm.scms) {
if( s instanceof hudson.scm.SubversionSCM) {
// Change updater
s.workspaceUpdater = new hudson.scm.subversion.UpdateUpdater()
println(s.workspaceUpdater.dump())
// Turn fail on external on all locations
s.locations.each { it.externalFailOption = true ; println(it.dump()) }
}
}
}
// Now save all the jobs to make the change persistent
jobs = Hudson.instance.items.findAll{job -> job.name}
jobs.each{
it.save()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.