Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 64 lines (48 sloc) 2.132 kB
# Script to update and build a shared deployment of CalCentral.
cd $( dirname "${BASH_SOURCE[0]}" )/..
LOG=`date +"$PWD/log/update-build_%Y-%m-%d.log"`
LOGIT="tee -a $LOG"
# Enable rvm and use the correct Ruby version and gem set.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
source .rvmrc
# update source tree (from which these scripts run)
echo | $LOGIT
echo "------------------------------------------" | $LOGIT
echo "`date`: Stopping CalCentral..." | $LOGIT
rm -rf deploy
mkdir deploy
cd deploy
echo | $LOGIT
echo "------------------------------------------" | $LOGIT
echo "`date`: Fetching new calcentral.knob from $WAR_URL..." | $LOGIT
curl -k -s $WAR_URL > calcentral.knob
echo "Unzipping knob..." | $LOGIT
jar xf calcentral.knob
if [ ! -d "versions" ]
echo "`date`: ERROR: Missing or malformed calcentral.knob file!" | $LOGIT
exit 1
echo "Last commit in calcentral.knob:" | $LOGIT
cat versions/git.txt | $LOGIT
# fix permissions on files that need to be executable
chmod u+x ./script/*
chmod u+x ./vendor/bundle/jruby/1.9/bin/*
find ./vendor/bundle -name | xargs chmod u+x
echo | $LOGIT
echo "------------------------------------------" | $LOGIT
echo "`date`: Deploying new CalCentral knob..." | $LOGIT
bundle exec torquebox deploy calcentral.knob --env=production | $LOGIT
echo "Copying assets into /var/www/html/calcentral" | $LOGIT
cp -Rvf public/assets /var/www/html/calcentral/ | $LOGIT
echo "Deleting old assets from /var/www/html/calcentral/assets" | $LOGIT
find /var/www/html/calcentral/assets -type f -mtime +$MAX_ASSET_AGE_IN_DAYS -delete | $LOGIT
echo "Copying bCourses static files into /var/www/html/calcentral" | $LOGIT
cp -Rvf public/canvas /var/www/html/calcentral/ | $LOGIT
echo "Copying OAuth static files into /var/www/html/calcentral" | $LOGIT
cp -Rvf public/oauth /var/www/html/calcentral/ | $LOGIT
Jump to Line
Something went wrong with that request. Please try again.