Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Delete all jenkins jobs

import jenkins.model.*

Jenkins.instance.items.findAll { job ->

  if (job.name =~ /^jenkins/) {
      println 'SKIPPING ' + job.name
  } else {
      println job.name
    job.delete()

  }
}