docs: рекомендуемое обновление через SHOP_ROOT и server-update.sh
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -125,12 +125,15 @@ cd "$SHOP_ROOT"
|
||||
sudo SHOP_INSTALL_DIR="$SHOP_ROOT" SHOP_GIT_URL="$SHOP_GIT_URL" bash scripts/quick-deploy-ubuntu.sh
|
||||
```
|
||||
|
||||
**Обновление** (сайт уже работает):
|
||||
**Обновление** (сайт уже работает) — **лучше так** (из любого каталога):
|
||||
|
||||
```bash
|
||||
export SHOP_ROOT=/opt/shop/shop10
|
||||
bash "$SHOP_ROOT/scripts/server-update.sh"
|
||||
```
|
||||
|
||||
`SHOP_ROOT` — путь к клону с `package.json` (у вас может быть `/opt/shop` вместо `/opt/shop/shop10`).
|
||||
|
||||
Не копируйте в shell шаблоны вроде `<URL_РЕПОЗИТОРИЯ>` — это подсказки в тексте, не команды.
|
||||
|
||||
Подробно: **[wiki/Server-Operations.md](wiki/Server-Operations.md)** (PostgreSQL PGDG, git, systemd, порт 3000).
|
||||
@@ -203,14 +206,14 @@ journalctl -u shop -n 5 --no-pager
|
||||
|
||||
См. **[wiki/Server-Operations.md](wiki/Server-Operations.md)**.
|
||||
|
||||
**Рекомендуемый способ** (надёжнее, чем вручную `cd` и `git pull`):
|
||||
|
||||
```bash
|
||||
export SHOP_ROOT=/opt/shop
|
||||
cd "$SHOP_ROOT"
|
||||
bash scripts/git-sync.sh # если detached HEAD
|
||||
bash scripts/server-update.sh
|
||||
export SHOP_ROOT=/opt/shop/shop10
|
||||
bash "$SHOP_ROOT/scripts/server-update.sh"
|
||||
```
|
||||
|
||||
`WorkingDirectory` в `deploy/shop.service` = ваш `$SHOP_ROOT`.
|
||||
`WorkingDirectory` в `deploy/shop.service` должен совпадать с `$SHOP_ROOT`.
|
||||
|
||||
Скрипт: `git pull` → `npm install` → проверка PostgreSQL → `restart shop` → `curl /health` → `reload caddy`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user