Skip to content

Instantly share code, notes, and snippets.

@codatory
Created August 8, 2013 03:08
Show Gist options
  • Save codatory/6181115 to your computer and use it in GitHub Desktop.
Save codatory/6181115 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo '
GIT_REPO=$HOME/site
TMP_GIT_CLONE=$HOME/tmp/site
# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
# Then try to load from a root install
source "/usr/local/rvm/scripts/rvm"
else
printf "ERROR: An RVM installation was not found.\n"
fi
rvm use 2.0.0-p0@blog --create
git clone $GIT_REPO $TMP_GIT_CLONE
cd $TMP_GIT_CLONE
bundle --quiet
jekyll build --destination /var/www/codatory.com
rsync -crm --compress --times --delete-after --delay-updates --human-readable /var/www/codatory.com/ [email protected]:/var/www/blog
rsync -crm --compress --times --delete-after --delay-updates --human-readable /var/www/codatory.com/ [email protected]:/var/www/blog
rsync -crm --compress --times --delete-after --delay-updates --human-readable /var/www/codatory.com/ [email protected]:/var/www/blog
rm -rf $TMP_GIT_CLONE' | batch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment