Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Jenkins のスクリプトコンソールで、Job の JDK を一括変換
jobs = jenkins.model.Jenkins.instance.items
oldJDK = jenkins.model.Jenkins.instance.getJDK("JavaSE 8u40")
newJDK = jenkins.model.Jenkins.instance.getJDK("JavaSE 8u45")
jobs.each {
if (it.JDK == oldJDK) {
it.JDK = newJDK
it.save()
println "updated ${it.name}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment