Skip to content

Instantly share code, notes, and snippets.

@holysugar
Created August 26, 2011 12:11
Show Gist options
  • Save holysugar/1173288 to your computer and use it in GitHub Desktop.
Save holysugar/1173288 to your computer and use it in GitHub Desktop.
exec rails_best_practices for jenkins plot plugin
#!/bin/sh
cd `dirname $0`/..
OUTDIR=reports
OUTFILE=$OUTDIR/rails_best_practices.properties
TMPFILE=`mktemp $OUTDIR/rails_best_practices.XXXXXX`
mkdir $OUTDIR 2> /dev/null
rails_best_practices > $TMPFILE
STATUS=$?
if [ $STATUS -eq 0 ]; then
echo "YVALUE=0" > $OUTFILE
else
NUM=`awk '/^Found [0-9]+ errors/{ print $2; }' < $TMPFILE`
echo "YVALUE=$NUM" > $OUTFILE
fi
rm $TMPFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment