Skip to content

Instantly share code, notes, and snippets.

@pedroburon
Created March 15, 2013 16:15
Show Gist options
  • Save pedroburon/5171062 to your computer and use it in GitHub Desktop.
Save pedroburon/5171062 to your computer and use it in GitHub Desktop.
Post compile hook for django heroku projects
#!/usr/bin/env bash
set -eo pipefail
# The post_compile hook is run by heroku-buildpack-python
echo "-----> I'm post-compile hook"
# Work around Heroku bug whereby pylibmc isn't available during
# compile phase. See: https://github.com/heroku/heroku-buildpack-python/issues/57
export MEMCACHE_SERVERS='' MEMCACHIER_SERVERS=''
if [ -f bin/run_migrations ]; then
echo "-----> Running run_migrations"
chmod +x bin/run_migrations
bin/run_migrations
fi
if [ -f bin/install_nodejs ]; then
echo "-----> Running install_nodejs"
chmod +x bin/install_nodejs
bin/install_nodejs
if [ -f bin/install_less ]; then
echo "-----> Running install_lessc"
chmod +x bin/install_less
bin/install_less
fi
fi
if [ -f bin/run_compress ]; then
echo "-----> Running run_compress"
chmod +x bin/run_compress
bin/run_compress
fi
echo "-----> Post-compile done"
#!/usr/bin/env bash
set -eo pipefail
python manage.py syncdb --migrate --noinput 2>&1
@edmorley
Copy link

edmorley commented Sep 4, 2015

It looks like the MEMCACHE_SERVERS workaround isn't needed now, as of:
heroku/heroku-buildpack-python@b891049

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment