INIT
This commit is contained in:
40
container-filesystem/setup-app.sh
Executable file
40
container-filesystem/setup-app.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
|
||||
### config ###
|
||||
PYTHON="python3"
|
||||
PIP="pip3"
|
||||
|
||||
### argv ###
|
||||
if test $# -lt 2 ; then
|
||||
echo "Usage: $0 <SOURCE DIRECTORY> <WSGI DIRECTORY>" >&2
|
||||
exit 64
|
||||
fi
|
||||
SOURCE_DIR="$1"
|
||||
WSGI_DIR="$2"
|
||||
|
||||
### action ###
|
||||
echo "Install application from $SOURCE_DIR"
|
||||
cd "$SOURCE_DIR"
|
||||
$PIP install -e .
|
||||
|
||||
echo "Setup WSGI application in $WSGI_DIR"
|
||||
django-dav-admin setup "$WSGI_DIR"
|
||||
|
||||
echo "Enable modules"
|
||||
$PYTHON "${WSGI_DIR}/manage.py" enable_module dav_auth
|
||||
$PYTHON "${WSGI_DIR}/manage.py" enable_module dav_events
|
||||
$PYTHON "${WSGI_DIR}/manage.py" enable_module dav_registration
|
||||
$PYTHON "${WSGI_DIR}/manage.py" enable_module dav_event_office
|
||||
|
||||
echo "Collect static files"
|
||||
$PYTHON "${WSGI_DIR}/manage.py" collectstatic --noinput
|
||||
|
||||
echo "Disable DEBUG mode"
|
||||
cat <<E-O-H >> "${WSGI_DIR}/main/settings.py"
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
# DEBUG = False
|
||||
E-O-H
|
||||
|
||||
echo "Done"
|
||||
### end ###
|
||||
Reference in New Issue
Block a user