blob: ef6ce0cd3d8688b652c6ee7b177248180354144c [file] [log] [blame]
Jakub Josef4edd7432017-05-10 17:58:56 +02001package com.mirantis.mk
2
3/**
4 *
5 * Jenkins common functions
6 *
7 */
8
9/**
10 * Get Jenkins job running builds
11 * @param jobName job name
12 * @return list of running builds
13 */
Jakub Joseffbe8c7c2017-05-11 13:35:11 +020014@NonCPS
Jakub Josef4edd7432017-05-10 17:58:56 +020015def getJobRunningBuilds(jobName){
Jakub Joseffbe8c7c2017-05-11 13:35:11 +020016 def job = Jenkins.instance.items.find{it -> it.name.equals(jobName)}
17 if(job){
18 return job.builds.findAll{build -> build.isBuilding()}
19 }
20 return []
Jakub Josef4edd7432017-05-10 17:58:56 +020021}