Last active
August 29, 2015 14:15
-
-
Save obcode/7072e2f047164dd73184 to your computer and use it in GitHub Desktop.
Jenkins - clone a template project
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
import hudson.model.* | |
// Begin Parameters | |
template = "md2html" | |
newname = template // | |
repoprefix = "ssh://git@ob.cs.hm.edu:8022/braun/14WS/compiler/md2html" | |
view = new ListView("braun-compiler") | |
noOfGroups = 12 | |
// End Parameters | |
Hudson.instance.addView(view) | |
item = Hudson.instance.getItem(template) | |
for(grp in 1..noOfGroups) | |
{ | |
grpstr = "-grp" + ((grp<10) ? "0"+grp : grp) | |
newName = name + grpstr | |
repository = repoprefix + grpstr | |
job = Hudson.instance.copy(item, newName) | |
job.scm = new hudson.plugins.git.GitSCM(repository) | |
job.save() | |
view.add(job) | |
println(" $item.name copied as $newName with $repository") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment