From: Lorin Hochstein Date: Tue, 24 Jan 2017 06:14:21 +0000 (-0800) Subject: Add entrypoint X-Git-Url: https://git.halfball.org/?a=commitdiff_plain;h=41186b6019ef5492c44200bc8c8ae080db52cb1f;p=ansiblebook.git Add entrypoint --- diff --git a/ch13/ansible/roles/mezzanine/files/entrypoint.sh b/ch13/ansible/roles/mezzanine/files/entrypoint.sh new file mode 100644 index 0000000..57ba6ea --- /dev/null +++ b/ch13/ansible/roles/mezzanine/files/entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Adapted from https://github.com/ansible/django-gulp-nginx +MANAGE=/srv/project/manage.py + +set -x + +if [[ $@ == *"gunicorn"* || $@ == *"runserver"* ]]; then + if [[ -f $MANAGE ]]; then + $MANAGE migrate --noinput + $MANAGE collectstatic --noinput + /srv/bin/setsite.py + /srv/bin/setadmin.py + fi +fi + +