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 pod = | |
""" | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
labels: | |
name: worker | |
spec: | |
serviceAccountName: jenkins | |
containers: |
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 daysBefore = 30 | |
def currentMillis = System.currentTimeMillis() | |
def cutOfDate = System.currentTimeMillis() - 1000L * 60 * 60 * 24 * daysBefore | |
long sumDurationMillis = 0 | |
for (job in Jenkins.instance.getAllItems(Job.class)) { | |
def job_name = job.getFullName() | |
long durationMillis = 0 |
OlderNewer