fix: server-update ищет корень репо (в т.ч. /opt/shop/shop10)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user