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
| MAX_BUILDS = 5 | |
| MAX_ENV_BUILDS = 2 | |
| Jenkins.instance.getAllItems(org.jenkinsci.plugins.workflow.job.WorkflowJob.class).each { it -> | |
| def job = Jenkins.instance.getItemByFullName(it.fullName, Job.class) | |
| def limit = (it.fullName =~ /^environment/) ? MAX_ENV_BUILDS : MAX_BUILDS | |
| def recent = job.getBuilds().limit(limit) | |
| println "Processing job " + it.fullName + " " + it.class + " BuildCount: " + job.getBuilds().size() + " Limit: " + limit | |
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 jenkinsBase = // Set to Jenkins base URL | |
| def jenkinsJob = // Set to Jenkins job name | |
| def address = null | |
| def response = null | |
| def start = 0 // Start at offset 0 | |
| def cont = true // This semaphore holds the value of X-More-Data header value | |
| try { | |
| while (cont == true) { // Loop while X-More-Data value is equal to true | |
| address = "${jenkinsBase}/job/${jenkinsJob}/lastBuild/logText/progressiveText?start=${start}" | |
| println("${address}") |
OlderNewer