Skip to content

Instantly share code, notes, and snippets.

@samurailink3
Created April 8, 2013 10:12
Show Gist options
  • Save samurailink3/5335733 to your computer and use it in GitHub Desktop.
Save samurailink3/5335733 to your computer and use it in GitHub Desktop.
Octopress Post-Receive
#!/bin/bash
# Make sure you have $HOME/git/working created already
# Put this file in a bare repository, configure Octopress for local deployment.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
GEM_PATH=$GEM_PATH:$HOME/.gems
PATH=$PATH:$HOME/.gems/bin
site=www.example.com
GIT_WORK_TREE=$HOME/git/working git checkout -f
cd $HOME/git/working
bundle install
bundle exec rake generate
rm -rf /var/www/$site/*
cp -rf $HOME/git/working/public/* /var/www/$site/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment