Skip to content

Instantly share code, notes, and snippets.

@bastos
Created March 16, 2009 13:10
Show Gist options
  • Save bastos/79867 to your computer and use it in GitHub Desktop.
Save bastos/79867 to your computer and use it in GitHub Desktop.
Little Script to reload a rails app on server for tests...
#!/usr/bin/env sh
# On CRON:
# 00,15,30,45 * * * * /home/user/project/reload.sh >> /home/user/log/release_web.log 2>&1
echo "Rebuilding" > /home/user/project/current/public/index.html
# Update the code
svn update /home/user/project/current
# Run migrations
cd /home/user/project/current
rake RAILS_ENV=$RAILS_ENV db:migrate;
# Restart memcached.
/user/project/memcached-1.2.6/scripts/memcached-init restart
# Restart passenger intances
touch tmp/restart.txt
# Put the rebuild date in the public
date > /home/user/project/current/public/rebuild.txt
# Remove the message
rm /home/user/project/current/public/index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment