Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
find /srv/git -iname HEAD -prune -execdir sh -c 'git ls-tree -r HEAD --name-only | grep .env | xargs -I{} sh -c "git cat-file blob master:{} | awk -vREPO=$(pwd) -vFILE={} -vSEP=\# \"{ print REPO SEP FILE, \\\$0 }\" " ' \; | grep PORT | awk '{print $2, $1}' | sed -e 's/\/srv\/git\///' -e 's/.git\#.*//' | sort |
import hudson.model.* | |
// Only detect jobs that have the SCM property available | |
jobs = Hudson.instance.getAllItems().findAll { | |
job -> job.hasProperty("scm") | |
} | |
// Cheap formatting hack =) | |
maxWidth = Collections.max(jobs.collect { job -> job.fullName.length() }) | |
Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console