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 ongoingBuild = []
def failedRuns = []
def isFailed = false
+def similarJobQueued = 0;
// Loop while we have kernel versions remaining or jobs running
while ( kversions.size() != 0 || ongoingBuild.size() != 0 ) {
}
}
+ // 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()