Last active
February 18, 2016 12:57
-
-
Save bergantine/3870080 to your computer and use it in GitHub Desktop.
post-merge Git hook to install requirements if changed, compile stylesheets, syncdb, run a south migration on the database, and rebuild the haystack index using the active virtual environment's python installation. #bash #git #hook #django #compass #sass #pip #south #haystack
This file contains hidden or 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 | |
if [ $(git diff HEAD@{1} HEAD --name-only | grep 'requirements/development.txt' -c) -ne 0 ] | |
then | |
sudo $VIRTUAL_ENV/bin/pip install -r /vagrant/myproject/requirements/development.txt | |
fi | |
compass compile /vagrant/myproject/myproject/static_media/stylesheets -e production --force | |
$VIRTUAL_ENV/bin/python /vagrant/myproject/manage.py syncdb | |
$VIRTUAL_ENV/bin/python /vagrant/myproject/manage.py migrate | |
if [ $(cat /vagrant/myproject/requirements/development.txt | grep 'haystack' -c) -ne 0 ] | |
then | |
$VIRTUAL_ENV/bin/python /vagrant/myproject/manage.py rebuild_index --noinput | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment