Created
March 1, 2011 10:17
-
-
Save ikikko/848939 to your computer and use it in GitHub Desktop.
Jenkins上のAntプロパティを一括置換します
This file contains 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
def VIEW = 'XXXXXXXX' | |
def REPLACE = 'XXXXXXXXX' | |
// ジョブ群 | |
def items = hudson.model.Hudson.instance.getView(VIEW).items | |
items.each { | |
print "${it.name} : " | |
// ビルド環境 > Configure release build | |
it.buildWrappers.each { key, value -> | |
def ant = value.postBuildSteps[0] | |
def newAnt = new hudson.tasks.Ant(ant.targets, ant.antName, ant.antOpts, ant.buildFile, REPLACE) | |
value.postBuildSteps[0] = newAnt | |
} | |
// ビルド > Antの呼び出し | |
def ant = it.buildersList.get(0) | |
def newAnt = new hudson.tasks.Ant(ant.targets, ant.antName, ant.antOpts, ant.buildFile, REPLACE) | |
it.buildersList.replace(newAnt) | |
println 'ok' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment