-
-
Save utopius/1e50a4fab24420bc613af8f290540c94 to your computer and use it in GitHub Desktop.
jenkins job cloning
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
def projects = [ | |
"scala-nightly-checkinit", | |
"scala-nightly-main", | |
"scala-nightly-rangepos", | |
"scala-nightly-windows" | |
] | |
inst = jenkins.model.Jenkins.instance; | |
def oldVersion = "2.10.x" | |
def newVersion = "2.11.x" | |
for (p in projects) { | |
def templateProject = inst.getItem(p + "-" + oldVersion); | |
def newProject = inst.copy(templateProject, p + "-" + newVersion); | |
println("created " + newProject); | |
def branchParam = newProject.actions.find{ it instanceof ParametersDefinitionProperty }?.getParameterDefinition("branch"); | |
if (branchParam != null) { | |
branchParam.setDefaultValue(newVersion) ; | |
println("found and updated branch parameter"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment