aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKelley Spoon <kelley.spoon@linaro.org>2022-04-28 17:36:02 -0500
committerKelley Spoon <kelley.spoon@linaro.org>2022-04-28 17:36:02 -0500
commit7e5e6e7c94990e409e25e4e46eee1c9d2b385386 (patch)
treef05f89ea6552cbb9b6a9f3f4ceab4e46346d10b1
parent008357e6ec6012666f45115c587893dcd1399f20 (diff)
remove_deleted_jobs: script to remove obsoleted jobs
The run-jjb.py script requires that any job that it explicitly deletes have a yaml file the corresponds to the job name. For jobs that are generated from a template, this isn't possible, so they never end up getting deleted. This script will remove any job with a displayName set to "DELETE ME" Signed-off-by: Kelley Spoon <kelley.spoon@linaro.org>
-rw-r--r--remove_deleted_jobs.groovy14
1 files changed, 14 insertions, 0 deletions
diff --git a/remove_deleted_jobs.groovy b/remove_deleted_jobs.groovy
new file mode 100644
index 0000000..65a70de
--- /dev/null
+++ b/remove_deleted_jobs.groovy
@@ -0,0 +1,14 @@
+// Get a list of all jobs with a display name of 'DELETE ME'.
+// Used to clean up jobs created via template that the run-jbb.py
+// script will miss.
+//
+// Uncomment the delete line below to actually delete the jobs.
+
+def buildingJobs = Jenkins.instance.getAllItems(Job.class).findAll {
+ it.displayName == "DELETE ME"
+}
+
+for (job in buildingJobs) {
+ println "${job.name}";
+ //job.delete();
+}