forked from Exodus-Privacy/exodus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
63 lines (54 loc) · 1.32 KB
/
entrypoint.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
EXODUS_HOME="/home/exodus/exodus"
function createDB() {
cd ${EXODUS_HOME}/exodus/
python3 manage.py makemigrations --settings=exodus.settings.docker
python3 manage.py migrate --settings=exodus.settings.docker
}
function createUser() {
cd ${EXODUS_HOME}/exodus/
python3 manage.py createsuperuser --settings=exodus.settings.docker
}
function startWorker() {
cd ${EXODUS_HOME}/exodus/
export DJANGO_SETTINGS_MODULE=exodus.settings.docker; python3 manage.py celery worker -A exodus.core -l info
}
function startFrontend() {
cp /usr/local/lib/python3.5/dist-packages/root/.config/gplaycli/gplaycli.conf /home/exodus/.config/gplaycli/gplaycli.conf
cd ${EXODUS_HOME}/exodus/
python3 manage.py runserver --settings=exodus.settings.docker 0.0.0.0:8000
}
function importTrackers() {
cd ${EXODUS_HOME}/exodus/
python3 manage.py importtrackers --settings=exodus.settings.docker
}
function init() {
while ! pg_isready -h db -p 5432 > /dev/null 2> /dev/null; do
echo "Connecting to db (postgresql) Failed: Waiting ..."
sleep 1
done
createDB
importTrackers
echo "Exodus is ready."
startFrontend
}
case "${1}" in
"init")
init
;;
"create-db")
createDB
;;
"create-user")
createUser
;;
"start-worker")
startWorker
;;
"start-frontend")
startFrontend
;;
"import-trackers")
importTrackers
;;
esac