Hi,
I am trying to generate n-dimensional unit test jobs programmatically
via groovy scripting. As I am new to groovy and Jenkins API it took
some time to figure some things but I made good progress.
Currently I am stuck with setting a build step. I would like to set
the build step of the created job to "Execute Windows Batch Command"
and add 4 lines of code to it. How could I achieve this?
What's currently more or less working is the following (driven by some
for loops):
def create_project = { name ->
def job = inst.getItem("$name")
if (job == null)
{
job = inst.createProject(jenkins.model.FreeStyleProject, "$name");
}
job.disabled=false
job.setCustomWorkspace("\${WORKSPACE_D}\\\${JOB_NAME}")
job.scm = new
hudson.plugins.cloneworkspace.CloneWorkspaceSCM("NightlyDebug", "Not
Failed")
job.logRotator = new hudson.tasks.LogRotator(-1, 10, -1, 10)
job.addPublisher(new
hudson.plugins.templateproject.ProxyPublisher("Template"))
create_commandLine("$name") // creates the command line to use in
Execute Windows Batch Command
}
Any hints for the documentation I could read?
A big thanks for any hint!
Dirk
--
Never trust a short-haired guru