#!/bin/bash # Set default variables (if not before with ENV variables) if [ -z $CC_RUBY ]; then CC_RUBY=1.9.2; fi if [ -z $CC_GEMSET ]; then CC_GEMSET=crowdblog; fi # Initialize RVM source "$HOME/.rvm/scripts/rvm" # Change to the gemset rvm $CC_RUBY@$CC_GEMSET --create --install # Is bundler installed? which bundle || gem install bundler echo "-- Install Gem dependencies" bundle install echo "-- Migrations" # both rake db:migrates needed bundle exec rake db:migrate RAILS_ENV=test bundle exec rake db:migrate echo "-- Build project" export DISPLAY=:0.0 bundle exec rake EXIT_CODE=$? #echo "-- METRICS" #which metrical || gem install metrical #metrical > /dev/null 2>&1 exit $EXIT_CODE