forked from Metaculus/metaculus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
43 lines (31 loc) · 958 Bytes
/
deploy.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
#!/bin/bash
set -x;
source /home/ubuntu/.bashrc;
source /home/ubuntu/rewrite_env.sh;
sudo fuser -k 3000/tcp;
sudo fuser -k 8000/tcp;
tmux kill-session -t web_backend;
tmux kill-session -t web_frontend;
sudo service dramatiq stop
sudo service django_cron stop
cd /home/ubuntu/rewrite;
git fetch origin;
git reset --hard origin/main;
git pull origin main --force
poetry install;
poetry update;
cd front_end;
npm i;
npm run build;
cd ..;
poetry run python3 manage.py migrate;
poetry run python3 manage.py collectstatic --noinput;
export ALPHA_ACCESS_TOKEN="the open source rewrite";
tmux new-session -d -s web_backend;
tmux send-keys -t web_backend 'poetry run gunicorn metaculus_web.wsgi:application --workers 8 --bind 0.0.0.0:8000' C-m;
sudo service dramatiq start
sudo service django_cron start
cd front_end;
tmux new-session -d -s web_frontend;
tmux send-keys -t web_frontend 'npm run start -- -p 3000' C-m;
echo "Deployment script completed.";