This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import hudson.model.* | |
| import jenkins.model.Jenkins | |
| def timer = 5000 //5s timer | |
| def counter = 12 * 10 // 10 minutes reruns | |
| for (i = 0; i <counter; i++) { | |
| def q = Jenkins.instance.queue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def x = 0 | |
| for (job in Hudson.instance.getAllItems(org.jenkinsci.plugins.workflow.job.WorkflowJob)) { | |
| try{ | |
| def isZombie = job.getLastBuild().dump()==~ /.*state=null.*/ | |
| def isRunning = job.getLastBuild().completed | |
| if(!isRunning && isZombie ){ | |
| x = x +1 | |
| println "Candidate for Zombie: ${job}" | |
| job.getLastBuild().doKill() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| println new ProcessBuilder( 'sh', '-c', 'date').redirectErrorStream(true).start().text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "default-src * 'unsafe-inline' 'unsafe-eval'; font-src 'self' data:; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * 'unsafe-inline';") |
OlderNewer