40 lines
1.1 KiB
Bash
Executable File
40 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
|
|
|
|
test -f .env || { echo "Missing .env" >&2; exit 1; }
|
|
command -v goose >/dev/null || { echo "Missing goose" >&2; exit 1; }
|
|
|
|
git pull --ff-only
|
|
|
|
docker compose up -d postgres_evening_detective_server rustfs_evening_detective_server
|
|
docker compose up -d --wait postgres_evening_detective_server rustfs_evening_detective_server
|
|
|
|
# MIGRATIONS_DATABASE_URL must point to PostgreSQL from the server host.
|
|
set -a
|
|
. ./.env
|
|
set +a
|
|
test -n "${MIGRATIONS_DATABASE_URL:-}" || {
|
|
echo "Missing MIGRATIONS_DATABASE_URL in .env" >&2
|
|
exit 1
|
|
}
|
|
test -n "${SMTP_USER:-}" || {
|
|
echo "Missing SMTP_USER in .env" >&2
|
|
exit 1
|
|
}
|
|
test -n "${SMTP_PASSWORD:-}" || {
|
|
echo "Missing SMTP_PASSWORD in .env" >&2
|
|
exit 1
|
|
}
|
|
goose -dir ./migrations postgres "$MIGRATIONS_DATABASE_URL" up
|
|
|
|
docker compose up -d --build --force-recreate --remove-orphans \
|
|
evening_detective_server evening_detective_frontend mailserver
|
|
|
|
if ! docker compose exec -T mailserver setup email list | grep -Fq "$SMTP_USER"; then
|
|
docker compose exec -T mailserver setup email add "$SMTP_USER" "$SMTP_PASSWORD"
|
|
fi
|
|
|
|
docker compose ps
|