Files
mtusi2026lab2/scripts/restart.sh
T

17 lines
991 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
set -eu
# Restart hook для make test-persistence (tests/README.md) по образцу
# scripts/restart.example.sh. Перезапускает API и все хранилища стенда —
# PostgreSQL и Valkey — с сохранением volume, схемы и данных: без down -v,
# FLUSHALL и повторного наполнения. Кэш Valkey после рестарта пуст:
# persistence у него выключен, данные — в PostgreSQL. start api запускает
# и его зависимость migrate: повторный прогон миграций ничего не меняет.
# Готовность API ждёт сам тест. Секреты не печатает.
cd "$(dirname "$0")/.."
docker compose stop api
docker compose restart postgres valkey
# те же контейнеры: --wait только дожидается их healthcheck
docker compose up -d --wait postgres valkey
docker compose start api