Created
October 25, 2010 15:37
-
-
Save 0atman/645141 to your computer and use it in GitHub Desktop.
Simple git hook to auto deploy a django app to an 'unstable' testing server.
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 | |
# | |
# An example hook script that is called after a successful | |
# commit is made. | |
# | |
# To enable this hook, make this file executable. | |
echo "Starting auto-deploy..." | |
cd /usr/share/django | |
echo "Updating files..." | |
env -i git pull | |
echo "Removing old sqlite DB..." | |
env -i rm default.sqlite | |
echo "Running syncdb..." | |
env -i python manage.py syncdb --noinput | |
# Fixing permissions | |
env -i chmod 775 default.sqlite | |
env -i chgrp www-data default.sqlite | |
echo "...done." |
Thanks past Tris, I just used this again.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a simple git post-receive hook that deploys a django app with nothing more than a git-pull.