groovy script change subversion checkout url

356 views
Skip to first unread message

Ian Roberts

unread,
Apr 8, 2011, 4:15:40 PM4/8/11
to jenkins...@googlegroups.com
I thought it would be best to send this with description in title instead of 'Hi All'.

==================
I've been using jenkins for a while now with just the user interface to perform all tasks.

It's only now im discovering the advantages of running groovy scripts and hudson-ci. I've been doing stuff like disabling slaves and jobs ect for a while, but I'm looking for a way to change the repository url for subversion on some of the jobs.

I need a job that's running to change the repository url for another job, then kick off a build of that job.

Has anyone got any tips on how i should be doing this. i have looked at hudson.scm but i can't figure it out.

Thanks,
Ian

Vincent Hardion

unread,
Apr 11, 2011, 3:44:24 AM4/11/11
to jenkins...@googlegroups.com
Hi,

You can groovy script like this :

def hudson = hudson.model.Hudson.instance
def job = hudson.getJob("MyJob")
job.scm.locations.each{ println it } //print current location
job.scm = new hudson.scm.SubversionSCM("http://test")

Best regards,

Vincent

Reply all
Reply to author
Forward
0 new messages