-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·23 lines (15 loc) · 1.09 KB
/
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
#!/bin/bash
# Mainnet frontend
(cd frontend && VITE_BASE_URL=https://scan.themelio.org npm run build && cp package.json build)
rsync -avz --progress --rsync-path="sudo rsync" ./frontend/build/ [email protected]:/var/www/melscan-frontend/
# Testnet frontend
(cd frontend && rm -rfv build && VITE_BASE_URL=https://scan-testnet.themelio.org npm run build && cp package.json build)
rsync -avz --progress --rsync-path="sudo rsync" ./frontend/build/ [email protected]:/var/www/melscan-frontend-testnet/
# Backend
(cd backend && cargo build --release --locked --target x86_64-unknown-linux-musl)
rsync -avz --delete --progress --rsync-path="sudo rsync" ./backend/target/x86_64-unknown-linux-musl/release/melscan-backend [email protected]:/usr/local/bin/melscan-backend
# Restart services
ssh -v [email protected] sudo systemctl restart melscan-mainnet-backend
ssh -v [email protected] sudo systemctl restart melscan-mainnet-frontend
ssh -v [email protected] sudo systemctl restart melscan-testnet-backend
ssh -v [email protected] sudo systemctl restart melscan-testnet-frontend