django-jenkins

How to change a Git URL in all Jenkins jobs

耗尽温柔 提交于 2019-12-10 10:11:52
问题 I have more than 100 jobs in Jenkins and I have to change a Git URL in each and every job since we changed the git server. I must traverse each job and change the Git URL. Can 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 : "

How to change a Git URL in all Jenkins jobs

一笑奈何 提交于 2019-12-06 03:11:26
I have more than 100 jobs in Jenkins and I have to change a Git URL in each and every job since we changed the git server. I must traverse each job and change the Git URL. Can 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. The script below will modify all Git