jenkins pipline disbale Restart code example
Example 1: 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()
Example 2: restart jenkins in docker container
(jenkins_url)/safeRestart
(jenkins_url)/restart