Skip to content

Instantly share code, notes, and snippets.

@ppandiya
ppandiya / find-env-ports.sh
Created May 29, 2017 06:16 — forked from TheDauthi/find-env-ports.sh
Find PORT settings inside foreman .env files.
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
@ppandiya
ppandiya / show-scm-path.groovy
Created May 29, 2017 06:15 — forked from TheDauthi/show-scm-path.groovy
Gets a list of SCMs in use by Jenkins. Displays the list of remote configs.
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() })
@ppandiya
ppandiya / README.md
Created April 5, 2017 04:15 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.