From 41186b6019ef5492c44200bc8c8ae080db52cb1f Mon Sep 17 00:00:00 2001 From: Lorin Hochstein Date: Mon, 23 Jan 2017 22:14:21 -0800 Subject: [PATCH] Add entrypoint --- ch13/ansible/roles/mezzanine/files/entrypoint.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ch13/ansible/roles/mezzanine/files/entrypoint.sh 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 + + -- 2.44.0