Hi,
i would have a look, if these builds can be started as downstream-jobs, without
waiting for those to finisch. Afterwards try polling jobs you're interested in
instead.
Haven't adapted this approach yet, but may look like this partly:
Joe
import hudson.model.*
// For each job
for (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")
}
}
processed by David.fx
Subject: Re: How to stop job at run time (29-Jun-2015 11:27)
From: Panikera Raj <[email protected]>
To: [email protected]
Hi Guys,
Any update on this...
Regards,
Panikera
On Fri, Jun 26, 2015 at 5:46 PM, Panikera Raj <[email protected]> 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 [email protected].
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.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/DIIE.00005CD20074486E%40192.168.11.6.
For more options, visit https://groups.google.com/d/optout.