-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
29 lines (23 loc) · 804 Bytes
/
run.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
#! /bin/bash
[ ! -f .env.dev ] || export $(grep -v '^#' .env.dev | xargs)
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cleanup() {
kill 0
wait
echo "All processes terminated."
exit 0
}
# kill processes on FRONT_DEV_PORT / API_DEV_PORT / dramatiq
trap cleanup SIGINT SIGTERM
# (
# (cd api/ && bash run.sh) &
# (cd front/ && venv/bin/python manage.py runserver $FRONT_DEV_PORT) &
# (cd front/ && venv/bin/python manage.py rundramatiq -t 1 -p 1);
# )
cd $ROOT_DIR/api/ && bash run.sh &
api_pid=$!
cd $ROOT_DIR/front/ && venv/bin/python manage.py runserver $FRONT_DEV_PORT &
front_server_pid=$!
cd $ROOT_DIR/front/ && venv/bin/python manage.py rundramatiq -t 1 -p 1 &
front_dramatiq_pid=$!
wait $api_pid $front_server_pid $front_dramatiq_pid