Skip to content

Instantly share code, notes, and snippets.

@kevinzen
Forked from dmerrick/deploy_script.sh
Created October 4, 2010 19:52
Show Gist options
  • Save kevinzen/610310 to your computer and use it in GitHub Desktop.
Save kevinzen/610310 to your computer and use it in GitHub Desktop.
#!/bin/bash
# This script fills in some of the gaps on an Engine Yard cluster deploy.
# -Dana
# I could probably use ARGV for this, but whatever.
THIS_ENV=staging
# move into our home directory
cd
# okay let's set up TVLM
if [ ! -d "$HOME/tvlm" ]; then
if [ -d "/data/TVLM_QA/current" ]; then
ln -s /data/TVLM_QA/current $HOME/tvlm
else
echo "Could not find a current deploy of TVLM, please deploy it."
exit 1
fi
fi
# TVLM-specific tasks
cd $HOME/tvlm
sudo gem install rdoc
sudo RAILS_ENV=$THIS_ENV rake gems:install
sudo gem uninstall daemons -v1.1.0
sudo gem install daemons -v1.0.10
# set up the db
echo "Would you like to reset the DB?"
read -n1 -p "[Y]es, [N]o, [A]bort: "
echo
case $REPLY in
y | Y)
sudo RAILS_ENV=$THIS_ENV rake db:migrate:reset
sudo RAILS_ENV=$THIS_ENV rake db:seed
sudo RAILS_ENV=$THIS_ENV rake app:load_demo_data
;;
n | N)
echo "Skipping this step."
;;
a | A)
echo "Aborting!"
exit 2
;;
* )
echo "I don't understand your input. Skipping this step!"
;;
esac
# now let's do CP
if [ ! -d "$HOME/cp" ]; then
if [ -d "/data/ConsumerPortal_qa/current" ]; then
ln -s /data/ConsumerPortal_qa/current $HOME/cp
else
echo "Could not find a current deploy of CP, please deploy it."
exit 1
fi
fi
cd $HOME/cp
sudo RAILS_ENV=$THIS_ENV rake gems:install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment