cd /path/to/mangrove
git pull
cd web && npm ci && npm run build && cd .. # rebuild the dashboard first
go build -o /root/mangrove-new ./cmd/mangrove # then the binary that embeds it
cp /usr/local/bin/mangrove /root/mangrove-prev # keep the old one
cp /root/mangrove-new /usr/local/bin/mangrove-staged
mv /usr/local/bin/mangrove-staged /usr/local/bin/mangrove # atomic swap
systemctl restart mangrove
systemctl is-active mangrove
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:7777/healthz # expect 200