Yes, I was able to achieve that.

jenkins@js:~/jobs$ find . -name config.xml | xargs grep "devil" | awk -F 
":" '{print $1}' | grep vampire | xargs sed -i -e 
's/<url>oldgit\.mv\.ab\.com:\/sandbox\/devil\/moon2/<url>newgit\@jenkins\-git\.mv.\ab\.com:vampire/g'

But I really wanted to get a groovy script which can traverse through each 
job configuration and change values. It will be useful in many situations.

Thanks,
M

On Sunday, February 9, 2014 11:21:32 AM UTC-8, Samuel Nobs wrote:
>
> alternatively, you could use sed or perl or whatever scripting language 
> you prefer to change the url in the *.xml files and then reload the jenkins 
> config
>
> cheers,
> sam
>
>
> On Sat, Feb 8, 2014 at 2:44 PM, Maneesh M P <[email protected]<javascript:>
> > wrote:
>
>> I have more than 100 jobs in my jenkins and I have to change git url in 
>> each and every job since we have changed the git server.
>> I have to traverse each job and change the git URL, could anyone help me 
>> with a groovy script? 
>>
>> I was able to traverse each job, but not able to get the git url or 
>> change it.
>>
>> import hudson.plugins.emailext.*
>> import hudson.model.*
>> import hudson.maven.*
>> import hudson.maven.reporters.*
>> import hudson.tasks.*
>>
>> // For each project
>> for(item in Hudson.instance.items) {
>>  println("JOB : "+item.name);
>> }
>>
>> I badly need help in this, please someone help me.
>>
>>
>> Thanks,
>> M
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Samuel Nobs
> Senior Design Engineer
> Tait Communications
> DDI: +64 7 825 7538
> Email: [email protected] <javascript:>
>
> <http://www.taitradio.com>
> www.taitradio.com
>
>  
> ------------------------------
> This email, including any attachments, is only for the intended recipient. 
> It is subject to copyright, is confidential and may be the subject of legal 
> or other privilege, none of which is waived or lost by reason of this 
> transmission.
> If you are not an intended recipient, you may not use, disseminate, 
> distribute or reproduce such email, any attachments, or any part thereof. 
> If you have received a message in error, please notify the sender 
> immediately and erase all copies of the message and any attachments.
> Unfortunately, we cannot warrant that the email has not been altered or 
> corrupted during transmission nor can we guarantee that any email or any 
> attachments are free from computer viruses or other conditions which may 
> damage or interfere with recipient data, hardware or software. The 
> recipient relies upon its own procedures and assumes all risk of use and of 
> opening any attachments.
> ------------------------------
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to