Created
June 22, 2012 07:16
-
-
Save tancnle/2970949 to your computer and use it in GitHub Desktop.
Commit generated metric-fu report to metrics repo
This file contains 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
#!/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