Commit 6c96d2
2024-12-30 11:02:56 Steven Anderson: init/dev/null .. ScriptFU/jenkins.md | |
@@ 0,0 1,17 @@ | |
+ | # jenkins |
+ | |
+ | #### kill jobs |
+ | ```groovy |
+ | import jenkins.model.Jenkins |
+ | |
+ | def projectPath = "<project_path>" |
+ | |
+ | Jenkins.instance.getAllItems(jenkins.model.ItemGroup).each { itemGroup -> |
+ | if (itemGroup.fullName == projectPath) { |
+ | itemGroup.getAllItems().each { job -> |
+ | println("Stopping job: ${job.fullName}") |
+ | job.doStop() |
+ | } |
+ | } |
+ | } |
+ | ``` |