Skip to content

Instantly share code, notes, and snippets.

@utopius
Forked from mdr/update-svn-location.groovy
Created June 7, 2016 08:30
Show Gist options
  • Save utopius/931b2a8f803315c77eaf50957db99861 to your computer and use it in GitHub Desktop.
Save utopius/931b2a8f803315c77eaf50957db99861 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