Skip to content

Instantly share code, notes, and snippets.

@queil
Last active October 26, 2020 15:03
Show Gist options
  • Save queil/e4c1c9a4108b05a27f12be24c2c79c83 to your computer and use it in GitHub Desktop.
Save queil/e4c1c9a4108b05a27f12be24c2c79c83 to your computer and use it in GitHub Desktop.
Jenkins: kill all jobs
Jenkins.instance.getAllItems(AbstractItem.class)
.findAll {job -> job.fullName.matches("your-job-regex")}
.each { job -> job.getLastBuild().doKill() }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment