forked from ikatson/docker-reviewboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
42 lines (34 loc) · 1.32 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
PGUSER="${PGUSER:-reviewboard}"
PGPASSWORD="${PGPASSWORD:-reviewboard}"
PGDB="${PGDB:-reviewboard}"
# Get these variables either from PGPORT and PGHOST, or from
# linked "pg" container.
PGPORT="${PGPORT:-$( echo "${PG_PORT_5432_TCP_PORT:-5432}" )}"
PGHOST="${PGHOST:-$( echo "${PG_PORT_5432_TCP_ADDR:-127.0.0.1}" )}"
# Get these variable either from MEMCACHED env var, or from
# linked "memcached" container.
MEMCACHED_LINKED_NOTCP="${MEMCACHED_PORT#tcp://}"
MEMCACHED="${MEMCACHED:-$( echo "${MEMCACHED_LINKED_NOTCP:-127.0.0.1}" )}"
DOMAIN="${DOMAIN:localhost}"
mkdir -p /var/www/
CONFFILE=/var/www/reviewboard/conf/settings_local.py
if [[ ! -d /var/www/reviewboard ]]; then
rb-site install --noinput \
--domain-name="$DOMAIN" \
--site-root=/ --static-url=static/ --media-url=media/ \
--db-type=postgresql \
--db-name="$PGDB" \
--db-host="$PGHOST" \
--db-user="$PGUSER" \
--db-pass="$PGPASSWORD" \
--cache-type=memcached --cache-info="$MEMCACHED" \
--web-server-type=lighttpd --web-server-port=8000 \
--admin-user=admin --admin-password=admin [email protected] \
/var/www/reviewboard/
fi
if [[ "${DEBUG}" ]]; then
sed -i 's/DEBUG *= *False/DEBUG=True/' "$CONFFILE"
cat "${CONFFILE}"
fi
exec uwsgi --ini /uwsgi.ini