【发布时间】:2014-02-08 01:53:24
【问题描述】:
我在 Jenkins 中有 100 多个工作,自从我们更改了 git 服务器后,我必须在每个工作中更改一个 Git URL。 我必须遍历每个作业并更改 Git URL。谁能帮我写一个 groovy 脚本?
我能够遍历每个作业,但无法获取或更改 Git URL:
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);
}
我非常需要帮助,请有人帮助我。
【问题讨论】:
-
jenkin 使用的 git 实例配置在一个中心位置;詹金斯的配置页面。选择 git 作为 SCM 的项目使用该设置。
标签: jenkins jenkins-plugins jenkins-cli django-jenkins jenkins-scriptler