Files
shop10/scripts/server-update.sh
T
shop 7060b0566a feat: PostgreSQL 17 вместо SQLite
pg + connect-pg-simple, async routes, docker-compose, скрипт setup-postgres.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-17 09:32:41 +03:00

24 lines
637 B
Bash

#!/bin/bash
# Обновление на сервере (запускать от root в /opt/shop)
set -euo pipefail
cd /opt/shop
git config --global --add safe.directory /opt/shop 2>/dev/null || true
git pull
npm install --omit=dev
if systemctl is-active --quiet shop 2>/dev/null; then
systemctl restart shop
sleep 1
curl -sf http://127.0.0.1:3000/health && echo || {
echo "shop не отвечает — смотрите: journalctl -u shop -n 30"
exit 1
}
systemctl reload caddy 2>/dev/null || true
echo "OK"
else
echo "Служба shop не установлена. См. deploy/shop.service в README."
fi