Skip to content

Instantly share code, notes, and snippets.

@ikikko
Created March 1, 2011 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikikko/848939 to your computer and use it in GitHub Desktop.
Save ikikko/848939 to your computer and use it in GitHub Desktop.
Jenkins上のAntプロパティを一括置換します
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