forked from sio2project/oioioi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
oioioi_init.sh
executable file
·37 lines (27 loc) · 927 Bytes
/
oioioi_init.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
#!/bin/bash
set -e
set -x
/sio2/oioioi/wait-for-it.sh -t 60 "db:5432"
mkdir -pv /sio2/logs/{supervisor,runserver,database}
echo "LOG: Migrating databases"
./manage.py migrate auth \
>/sio2/logs/database/migrate_auth.out \
2>/sio2/logs/database/migrate_auth.err
./manage.py migrate \
>/sio2/logs/database/migrate.out \
2>/sio2/logs/database/migrate.err
echo "LOG: loading test data"
./manage.py loaddata ../oioioi/oioioi_selenium/data.json
echo "LOG: Launching rabbitmq"
sudo /etc/init.d/rabbitmq-server start
echo "LOG: Launching OIOIOI"
cd /sio2/deployment
# We must add local bin to path because we do not use virtualenv
./manage.py supervisor \
> /sio2/logs/supervisor/out.log \
2> /sio2/logs/supervisor/err.log &
sleep 10
./manage.py supervisor start all
./manage.py runserver 0.0.0.0:8000 \
> /sio2/logs/runserver/out.log \
2> /sio2/logs/runserver/err.log