Skip to content

Instantly share code, notes, and snippets.

@mastier
Last active March 21, 2016 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mastier/0c22342a252bd3fde12d to your computer and use it in GitHub Desktop.
Save mastier/0c22342a252bd3fde12d to your computer and use it in GitHub Desktop.
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