-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupgrade_roling_servers
executable file
·33 lines (25 loc) · 1.7 KB
/
upgrade_roling_servers
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
#!/usr/bin/env bash
# Stop if any error
set -e
echo "Current statuses :"
supervisorctl status rolling_heritage:rolling_heritage_1
supervisorctl status rolling_creatif:rolling_creatif_1
echo "Stop Rollac clients"
supervisorctl stop rollac_heritage:rollac_heritage_1
supervisorctl stop rollac_creatif:rollac_creatif_1
echo "Stop Rolling servers"
supervisorctl stop rolling_heritage:rolling_heritage_1
supervisorctl stop rolling_creatif:rolling_creatif_1
echo "Upgrade servers"
su - rolling -c "cd /home/rolling/servers/heritage && source venv3.7/bin/activate && git pull origin && pip install -r requirements.txt && alembic upgrade head && maturin develop --release && python setup.py develop"
su - rolling -c "cd /home/rolling/servers/creatif && source venv3.7/bin/activate && git pull origin && pip install -r requirements.txt && alembic upgrade head && maturin develop --release && python setup.py develop"
echo compile wasm clients
su - rolling -c "cd /home/rolling/rollgui2_heritage && git pull && SERVER_ADDRESS=https://heritage.bux.fr cargo build --target wasm32-unknown-unknown --release && cp target/wasm32-unknown-unknown/release/rollgui2.wasm ~/servers/heritage/static/engine.wasm"
su - rolling -c "cd /home/rolling/rollgui2_creatif && git pull && SERVER_ADDRESS=https://creatif.bux.fr cargo build --target wasm32-unknown-unknown --release && cp target/wasm32-unknown-unknown/release/rollgui2.wasm ~/servers/creatif/static/engine.wasm"
echo "Start Rolling servers"
supervisorctl start rolling_heritage:rolling_heritage_1
supervisorctl start rolling_creatif:rolling_creatif_1
sleep 2
echo "Start Rollac clients"
supervisorctl start rollac_heritage:rollac_heritage_1
supervisorctl start rollac_creatif:rollac_creatif_1