Newer
Older
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
43
#!/bin/bash
# --------------------------------------------------------------- #
create_link()
{
ln -s $1 $2 2> /dev/null
if [ $? -eq 0 ]; then
echo "[ OK ] Link created: ${1}->${2}"
else
echo "[FAILED] No such file or directory: ${1}"
exit 1
fi
}
# --------------------------------------------------------------- #
echo "Step 01."
cd $APP_PATH/
marker_file="marker_file_step_01"
if [ -f $marker_file ]; then
echo "$marker_file already exists"
else
echo "$marker_file does not exist"
django-admin startproject config .
create_link src/onegeo_suite/ .
# Handle Django config files
if [ -f "config/urls.py" ]; then
rm config/urls.py
fi
if [ -f "config/settings.py" ]; then
rm config/settings.py
fi
cp src/docker/settings.py config/settings.py
cp src/docker/urls.py config/urls.py
# Wait for the postgres server
echo "Waiting for database..."
i=1
while true
do
if $(nc -z ${DB_HOST} 5432) ; then
echo "[${DB_HOST}] The database server is ready."
break
fi
echo "[Retry: $i] The database server is not ready. Next attempt in ${TIME_SLEEP:-1}s"
sleep ${TIME_SLEEP:-1}

m431m
committed
# python manage.py migrate
# Build static files
python manage.py collectstatic

m431m
committed

m431m
committed
python manage.py compilemessages --locale=fr