def kgitrepo = build.buildVariableResolver.resolve('kgitrepo')
def kverfloor = new kVersion(build.buildVariableResolver.resolve('kverfloor'))
def job = Hudson.instance.getJob(build.buildVariableResolver.resolve('kbuildjob'))
+def currentJobName = build.project.getFullDisplayName()
// Get the out variable
def config = new HashMap()
def kversion = kversions.pop()
def job_params = [
new StringParameterValue('mversion', mversion),
- new StringParameterValue('kversion', kversion.toString()),
+ new StringParameterValue('ktag', kversion.toString()),
new StringParameterValue('kgitrepo', kgitrepo),
]
}
}
+ // Check for queued similar job since we only want to run latest
+ // as Mathieu Desnoyers requirement
+ similarJobQueued = Hudson.instance.queue.items.count{it.task.getFullDisplayName() == currentJobName}
+ if ( similarJobQueued > 0 ) {
+ // Abort since new build is queued
+ build.setResult(hudson.model.Result.ABORTED)
+ throw new InterruptedException()
+ }
+
def i = ongoingBuild.iterator()
while ( i.hasNext() ) {
currentBuild = i.next()
// Print results
def matrixParent = currentBuild.get()
allBuilds.add(matrixParent)
- def kernelStr = matrixParent.buildVariableResolver.resolve("kversion")
+ def kernelStr = matrixParent.buildVariableResolver.resolve("ktag")
println "${matrixParent.fullDisplayName} (${kernelStr}) completed with status ${matrixParent.result}"
// Process child runs of matrixBuild
println "---Build report---"
for (b in allBuilds) {
- def kernelStr = b.buildVariableResolver.resolve("kversion")
+ def kernelStr = b.buildVariableResolver.resolve("ktag")
println "${b.fullDisplayName} (${kernelStr}) completed with status ${b.result}"
-}
-
-// Clean all builds
-// TODO: Delete only builds generated from this job run
-for (b in job.getBuilds()) {
- b.delete()
+ // Cleanup builds
+ try {
+ b.delete()
+ } catch (all) {}
}
// Mark this build failed if any child build has failed