Created
March 12, 2013 14:34
-
-
Save wbrady/5143367 to your computer and use it in GitHub Desktop.
Website (rails) post-merge hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
diff=`git diff --name-only HEAD@{1} HEAD` | |
gemfile=`expr "$diff" : ".*Gemfile.*"` | |
if [ ! "$gemfile" -eq 0 ] | |
then | |
echo "Running bundle install" | |
bundle install | |
fi | |
migrate=`expr "$diff" : ".*db/migrate/.*"` | |
if [ ! "$migrate" -eq 0 ] | |
then | |
echo "Migrating database" | |
bundle exec rake db:migrate | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment