Skip to content

Instantly share code, notes, and snippets.

@minhajuddin
Last active December 16, 2015 15:19
Show Gist options
  • Save minhajuddin/5455011 to your computer and use it in GitHub Desktop.
Save minhajuddin/5455011 to your computer and use it in GitHub Desktop.
source "/usr/local/rvm/scripts/rvm"
RAILS_ENV=production
PATH=$PATH:/usr/local/rvm/bin # Add RVM to PATH for scripting
source ~/.bash_profile
#!/usr/bin/env bash
set -e
oldrev=$1
newrev=$2
run() {
[ -x $1 ] && $1 $oldrev $newrev
}
echo files changed: $(git diff $oldrev $newrev --diff-filter=ACDMR --name-only | wc -l)
umask 002
git submodule init && git submodule sync && git submodule update
rvm use .
run deploy/before_restart
run deploy/restart && run deploy/after_restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment