-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·45 lines (33 loc) · 903 Bytes
/
Copy pathdeploy.sh
File metadata and controls
executable file
·45 lines (33 loc) · 903 Bytes
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
44
45
#!/usr/bin/env bash
set -euo pipefail
APP_DIR="/home/gaspard/vixcpp/pico"
VIX="/home/gaspard/.local/bin/vix"
cd "$APP_DIR"
echo "==> Pull latest code"
git fetch origin main
git reset --hard origin/main
echo "==> Update and install dependencies"
"$VIX" registry sync
"$VIX" update
"$VIX" install
echo "==> Build Pico"
"$VIX" build --build-target all -v
echo "==> Restart service"
sudo -n systemctl restart pico.service
echo "==> Check service"
sudo -n systemctl status pico.service --no-pager
echo "==> Waiting for Pico HTTP health"
for i in {1..20}; do
if curl -fsS http://127.0.0.1:8080/health >/dev/null; then
echo "Pico local health is ready"
break
fi
echo "Waiting for Pico... attempt $i/20"
sleep 1
done
echo "==> Health checks"
"$VIX" health local
"$VIX" health public
echo "==> Production doctor"
sudo -n "$VIX" doctor production
echo "==> Pico deployed successfully"