Skip to content

Instantly share code, notes, and snippets.

@mdr
Created May 14, 2013 09:48
Show Gist options
  • Save mdr/5574848 to your computer and use it in GitHub Desktop.
Save mdr/5574848 to your computer and use it in GitHub Desktop.
Update SVN URL in Jenkins
import hudson.scm.*
newURL = "https://mvld-dev1.hcuk.pri:18080/svn/dev/hccf/test_automation/functional/trunk/selenium-framework/hitachi-automation"
for (job in Hudson.instance.items) {
if (job.scm instanceof SubversionSCM) {
location = job.scm.locations[0]
println(location)
newLocation = new SubversionSCM.ModuleLocation(newURL, location.local)
newscm = new SubversionSCM([newLocation], job.scm.workspaceUpdater, job.scm.browser,
job.scm.excludedRegions, job.scm.excludedUsers, job.scm.excludedRevprop, job.scm.excludedCommitMessages, job.scm.includedRegions)
job.scm = newscm;
println("Updated SVN location for $job.name to $newURL")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment