Skip to content

Instantly share code, notes, and snippets.

@sudara
Created July 8, 2010 12:15
Show Gist options
  • Select an option

  • Save sudara/467935 to your computer and use it in GitHub Desktop.

Select an option

Save sudara/467935 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Deployanatoring teh codez!"
ssh linode-deploy '
cd /data/alonetone/current;
if [[ $(git diff) > "" ]];
then
echo "WARNING: local changes on server, exiting!";
exit 0;
fi;
git fetch;
if [[ $(git diff origin/master Gemfile) > "" ]];
then
echo "Gemfile changed, bundle installing...";
git reset --hard origin/master; bundle install --without=test;
else
echo "skipping bundle install, gemfile has not changed since last time.";
git reset --hard origin/master;
fi
'
echo "Killing Mongrels! (one at a time)"
ssh linode 'monit restart mongrel_alonetone_5000; sleep 30;monit restart mongrel_alonetone_5001; sleep 30;monit restart mongrel_alonetone_5002'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment