Skip to content

Instantly share code, notes, and snippets.

@0atman
Created October 25, 2010 15:37
Show Gist options
  • Save 0atman/645141 to your computer and use it in GitHub Desktop.
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.
#!/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."
@0atman
Copy link
Author

0atman commented Oct 25, 2010

This is a simple git post-receive hook that deploys a django app with nothing more than a git-pull.

@0atman
Copy link
Author

0atman commented Apr 19, 2011

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