-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathstart_fursvp.sh
More file actions
40 lines (30 loc) · 1.1 KB
/
start_fursvp.sh
File metadata and controls
40 lines (30 loc) · 1.1 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
pkill gunicorn
pkill python3
git pull
# Check if git pull was successful
if [ $? -ne 0 ]; then
echo "Git pull failed. Exiting startup script." >&2
exit 1
fi
GUNICORN_PATH="gunicorn"
PYTHON_PATH="python3"
MANAGE_PY="./manage.py"
# --- Collect static files ---
echo "Starting Django-Q cluster..."
nohup "$PYTHON_PATH" "$MANAGE_PY" collectstatic --noinput
# --- Update git version in code ---
echo "Updating git version in cod..."
"$PYTHON_PATH" "$MANAGE_PY" get_git_version
# --- Start Gunicorn in the background ---
echo "Starting Web Server (Gunicorn)..."
nohup "$GUNICORN_PATH" fursvp.wsgi:application --bind 0.0.0.0:8003 >> fursvp.log 2>&1 &
# Get the PID of the last background command (Gunicorn)
GUNICORN_PID=$!
echo "Gunicorn started with PID: $GUNICORN_PID"
# --- Start Django-Q cluster in the background ---
echo "Starting Django-Q cluster..."
nohup "$PYTHON_PATH" "$MANAGE_PY" qcluster >> qcluster.log 2>&1 &
# Get the PID of the last background command (Django-Q cluster)
QCLUSTER_PID=$!
echo "Django-Q cluster started with PID: $QCLUSTER_PID"
echo "FURsvp server and Django-Q cluster initiated."