fix: server-update ищет корень репо (в т.ч. /opt/shop/shop10)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
shop
2026-05-17 13:14:06 +03:00
parent e71bfa35dc
commit 42177555ac
8 changed files with 90 additions and 18 deletions
+13 -3
View File
@@ -203,18 +203,28 @@ journalctl -u shop -n 5 --no-pager
## Обновление на сервере (git pull)
Каталог клона — там, где лежат `package.json` и `scripts/` (часто `/opt/shop` или `/opt/shop/shop10`):
```bash
cd /opt/shop
git config --global --add safe.directory /opt/shop
cd /opt/shop/shop10 # ваш путь к репозиторию
git config --global --add safe.directory "$(pwd)"
bash scripts/server-update.sh
```
Или одной командой (путь к скрипту в вашем клоне):
```bash
bash /opt/shop/shop10/scripts/server-update.sh
```
Скрипт сам найдёт корень репозитория. В `deploy/shop.service` поле `WorkingDirectory` должно указывать на тот же каталог.
Скрипт: `git pull``npm install` → проверка PostgreSQL → `restart shop``curl /health``reload caddy`.
Вручную:
```bash
cd /opt/shop
cd /opt/shop/shop10
git pull
npm install --omit=dev
systemctl restart shop