-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartserver.sh
More file actions
60 lines (56 loc) · 1.77 KB
/
Copy pathstartserver.sh
File metadata and controls
60 lines (56 loc) · 1.77 KB
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
#!/bin/bash
echo "PACKAGES WILL BE INSTALLED. THIS MAY BREAK YOUR EXISTING TOOLCHAIN."
echo "YOU ACCEPT ALL RESPONSIBILITY BY PROCEEDING."
read -r -p "Proceed? [Y/n] : " yn
case $yn in
Y|y) install;;
*) ;;
esac
install(){
python.exe -m pip install --upgrade pip
pip show django || pip install django
pip show djangorestframework || pip install djangorestframework
pip show djangorestframework-jwt || pip install djangorestframework-jwt
pip show djangorestframework-simplejwt || pip install djangorestframework-simplejwt
pip show djongo || pip install djongo
pip show celery || pip install celery
pip show crontab || pip install crontab
pip show django-crontab || pip install django-crontab
pip show django-cors-headers || pip install django-cors-headers
pip show channels==3.0.4 || pip install channels==3.0.4
pip show channels_redis==3.3.1 || pip install channels_redis==3.3.1
pip show elasticsearch || pip install elasticsearch
pip show django-elasticsearch-dsl || pip install django-elasticsearch-dsl
pip show minio || pip install minio
pip show django-storages boto3 || pip install django-storages boto3
}
# server
python3 manage.py makemigrations
python3 manage.py migrate
res="$?"
while [ "$res" != "0" ]
do
sleep 3;
python3 manage.py migrate
res="$?"
done
echo "STARTING COLTEAM SERVER"
nohup python3 manage.py runserver 0.0.0.0:8000 &
# redis
echo "INSTALLING REDIS SERVER"
if ! cd redis_mac; then
mkdir redis_mac && cd redis_mac || exit 1
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
cd redis-stable || exit 1
make
make test
sudo make install
cd ..
fi
echo "STARTING REDIS SERVER"
redis-server &
cd ..
# celery
echo "STARTING CELERY TASKS"
celery -A colteam worker --loglevel=info &