Last active
December 11, 2015 06:48
-
-
Save kazuhito-m/4561530 to your computer and use it in GitHub Desktop.
Jenkins Groovy Console exsamples.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ジョブの「依存するスナップショットがビルドされたときにビルド」を操作。 | |
Jenkins.instance.items.each { | |
println "job name : ${it.name}" | |
println "ignoreUpstremChanges : ${it.ignoreUpstremChanges}" | |
it.ignoreUpstremChanges = false | |
println "after change : ${it.ignoreUpstremChanges}" | |
} | |
// ジョブの「E-mailでの通知」を操作。 | |
Jenkins.instance.items.each { | |
println "job name : ${it.name}" | |
if (!(it instanceof hudson.model.FreeStyleProject)) { | |
// メール設定が在るかどうか捜索。 | |
def mailReport = it.reporters.find {r-> r instanceof hudson.maven.reporters.MavenMailer} | |
// あったら設定の塊ごと消す。 | |
if (mailReport != null) { | |
println "ジョブ ${it.name} のE-Mail送信設定を削除します。" | |
it.reporters.remove(mailReport) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment