2014-10-29 22:06:54 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-11-17 19:25:26 +02:00
|
|
|
PATH=/home/deploy/realms-wiki/.venv/bin:/usr/local/bin:/usr/bin:/bin:$PATH
|
2014-10-29 22:06:54 +02:00
|
|
|
export PATH
|
|
|
|
|
2014-11-17 19:25:26 +02:00
|
|
|
LC_ALL=en_US.UTF-8
|
|
|
|
GEVENT_RESOLVER=ares
|
2014-10-29 22:06:54 +02:00
|
|
|
|
|
|
|
export LC_ALL
|
|
|
|
export GEVENT_RESOLVER
|
|
|
|
|
2014-09-19 00:44:01 +03:00
|
|
|
if [ "${REALMS_WIKI_CONFIG}" != "" ]; then
|
|
|
|
realms-wiki configure ${REALMS_WIKI_CONFIG}
|
|
|
|
fi
|
|
|
|
|
2014-10-29 22:06:54 +02:00
|
|
|
if [ "${REALMS_WIKI_WORKERS}" == "" ]; then
|
|
|
|
REALMS_WIKI_WORKERS=3
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${REALMS_WIKI_PORT}" == "" ]; then
|
|
|
|
REALMS_WIKI_PORT=5000
|
|
|
|
fi
|
|
|
|
|
|
|
|
exec gunicorn \
|
|
|
|
--name realms-wiki \
|
|
|
|
--access-logfile - \
|
|
|
|
--error-logfile - \
|
|
|
|
--worker-class gevent \
|
|
|
|
--workers ${REALMS_WIKI_WORKERS} \
|
|
|
|
--bind 0.0.0.0:${REALMS_WIKI_PORT} \
|
|
|
|
--user deploy \
|
|
|
|
--group deploy \
|
|
|
|
--chdir /home/deploy/realms-wiki \
|
|
|
|
'realms:create_app()' >>/var/log/realms-wiki/realms-wiki.log 2>&1
|