35 lines
1.5 KiB
Bash
35 lines
1.5 KiB
Bash
#!/bin/sh
|
|
set -eu
|
|
cd "$(dirname "$0")/../.."
|
|
CONFIG_FILE=${CONFIG_FILE:-.env}
|
|
SECRETS_LAUNCHER=${SECRETS_LAUNCHER:-deployment/secrets/han-secrets}
|
|
|
|
if [ "${HAN_SECRETS_ACTIVE:-0}" != "1" ]; then
|
|
[ -x "$SECRETS_LAUNCHER" ] || {
|
|
echo "Secret launcher is required: $SECRETS_LAUNCHER" >&2
|
|
exit 66
|
|
}
|
|
exec "$SECRETS_LAUNCHER" run --config "$CONFIG_FILE" -- "$0" "$@"
|
|
fi
|
|
|
|
if [ "${PITR_MARKER_CONFIRMED:-false}" != "true" ]; then
|
|
echo "Refusing migration: create provider PITR marker, then set PITR_MARKER_CONFIRMED=true" >&2
|
|
exit 64
|
|
fi
|
|
|
|
if [ -n "${HAN_RUNTIME_SECRET_MANIFEST:-}" ]; then
|
|
./scripts/validate-env "$CONFIG_FILE" --runtime-manifest "$HAN_RUNTIME_SECRET_MANIFEST"
|
|
else
|
|
./scripts/validate-env "$CONFIG_FILE" --runtime-env
|
|
fi
|
|
docker compose --env-file "$CONFIG_FILE" config --quiet
|
|
docker compose --env-file "$CONFIG_FILE" --profile ops run --rm migrate-api alembic current
|
|
docker compose --env-file "$CONFIG_FILE" --profile ops run --rm migrate-bitrix-local alembic current
|
|
docker compose --env-file "$CONFIG_FILE" --profile ops run --rm migrate-bitrix-sync alembic current
|
|
docker compose --env-file "$CONFIG_FILE" --profile ops run --rm migrate-sms alembic current
|
|
docker compose --env-file "$CONFIG_FILE" --profile ops run --rm migrate-api
|
|
docker compose --env-file "$CONFIG_FILE" --profile ops run --rm migrate-bitrix-local
|
|
docker compose --env-file "$CONFIG_FILE" --profile ops run --rm migrate-bitrix-sync
|
|
docker compose --env-file "$CONFIG_FILE" --profile ops run --rm migrate-sms
|
|
echo "Migrations completed; record revisions in release evidence."
|