Skip to content

Instantly share code, notes, and snippets.

@tancnle
Created June 22, 2012 07:16
Show Gist options
  • Save tancnle/2970949 to your computer and use it in GitHub Desktop.
Save tancnle/2970949 to your computer and use it in GitHub Desktop.
Commit generated metric-fu report to metrics repo
#!/bin/bash
set -e
set -v
# RVM shenanigans
source "$HOME/.rvm/scripts/rvm"
rvm --create use ree-1.8.7-2011.03@studio
# Setup database connection
password=`cat ../password.txt`
mysql_socket=`my_print_defaults client | grep socket | sed -e 's/.*socket=//'`
cat config/database.yml.ci | sed -e "s#PASSWORD#$password#g" -e "s#SOCKET#$mysql_socket#g" > config/database.yml
# Symlink the project metrics repo
rm -Rf ./tmp && ln -s /mnt/jenkins/userContent/metrics/${PROJ}_metrics/raw ./tmp
(cd /mnt/jenkins/userContent/metrics/${PROJ}_metrics && git pull origin master)
bundle install
bundle exec rake metrics:all --trace
sed -i -e "s/>workspace</>${PROJ}</" ./tmp/metric_fu/output/*.html
sed -i -e 's/"\/">metrics</"..\/index.html">metrics</' ./tmp/metric_fu/output/*.html
(cd /mnt/jenkins/userContent/metrics/${PROJ}_metrics && git add --all . && git commit -m "${PROJ} metrics update." && git pull --rebase origin master && git push origin master)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment