Answers for "jenkins delete all builds of a job"

0

jenkins delete all builds of a job

def jobName = "KPI_Measurements/KPI_Build_delete/KPI_delete_build"  
def job = Jenkins.getInstance().getItemByFullName(jobName, Job.class)
job.getBuilds().each { it.delete() }  
job.nextBuildNumber = 1   
job.save()
Posted by: Guest on October-26-2020

Browse Popular Code Answers by Language