Last active
March 21, 2016 23:31
-
-
Save mastier/0c22342a252bd3fde12d to your computer and use it in GitHub Desktop.
Fix Subversion plugin configuration in Jenkins in all jobs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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