import hudson.model.*// For each jobfor (item in Hudson.instance.items){ jobName = item.getFullDisplayName() // check that job is not building if (!item.isBuilding()) { // TODO: Modify the following condition to select which jobs to affect if (jobName == "MyJob") { println("Wiping out workspaces of job " + jobName) customWorkspace = item.getCustomWorkspace() println("Custom workspace = " + customWorkspace) for (node in Hudson.getInstance().getNodes()) { println(" Node: " + node.getDisplayName()) workspacePath = node.getWorkspaceFor(item) if (workspacePath == null) { println(" Could not get workspace path") } else { if (customWorkspace != null) { workspacePath = node.getRootPath().child(customWorkspace) } pathAsString = workspacePath.getRemote() if (workspacePath.exists()) { workspacePath.deleteRecursive() println(" Deleted from location " + pathAsString) } else { println(" Nothing to delete at " + pathAsString) } } } } } else { println("Skipping job " + jobName + ", currently building") }}
Original Message processed by David.fx
Subject: Re: How to stop job at run time (29-Jun-2015 11:27) From: To: Hi Guys,
Any update on this...
Regards,Panikera--
On Fri, Jun 26, 2015 at 5:46 PM, Panikera Raj <paniker...@gmail.com> wrote:
Hi All,
I have a scenario where I am using Build flow project in jenkins like below:
parallel ({build("NightlyBuilds")},{build("MemoryLeaks")})
so both NightlyBuilds, MemoryLeaks are going paralally but in memoryleaks project i have a check point, when flag become true so i need to stop full project how can i achieve this.
for reference you can see screen shot as well
Thanks in advance, You help greatly appreciated.
Regards,Panikera.
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAEzR4Zwu5HdQ%2BWWra4NBuG1-E3ZsD7Oy0tNwXcNQC-wOLTaAJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.