Skip to content

Commit

Permalink
job: new var
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmod committed Aug 11, 2017
1 parent 39ec05e commit df331ad
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions vars/job.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env groovy

def hasNewerQueuedJobs() {
def queue = jenkins.model.Jenkins.getInstance().getQueue().getItems()
for (int i=0; i < queue.length; i++) {
if (queue[i].task.getName() == env.JOB_NAME ) {
echo "Jobs in queue, aborting"
return true
}
}
return false
}

return this

0 comments on commit df331ad

Please sign in to comment.