【发布时间】:2012-01-11 17:05:52
【问题描述】:
有谁知道如何以非手动方式修改 Jenkins/Hudson 节点标签?我的意思是,彻底了解此工具提供的 CLI API 之类的 API(当然无需重新启动 Jenkins/Hudson)。
我的猜测是最好的选择是使用 Groovy 脚本进入 Jenkins/Hudson 的胆量。执行类似:
java -jar -s HUDSON_URL:8080 groovy /path/to/groovy.groovy
作为该脚本的内容,类似于:
for (aSlave in hudson.model.Hudson.instance.slaves) {
labels = aSlave.getAssignedLabels()
println labels
**aSlave.setLabel("blabla")** // this method doesn't exist, is there any other way???
}
提前致谢!
维克多
【问题讨论】:
标签: java groovy hudson jenkins