Files
ScadaBridge/infra/teardown.sh
T
Joseph Doherty 7b0b9c7365 refactor: rename ScadaLink → ZB.MOM.WW.ScadaBridge (code + projects + namespaces)
Solution + 23 src projects + 26 test projects renamed; folders, csproj,
namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated.
ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated.
SQL roles/logins, LDAP domains, CLI command name, and CLI config dir
(~/.scadalink → ~/.scadabridge) also renamed.

Build green; 5 Host.Tests fail awaiting SQL login rename in next commit.
Pre-existing StaleTagMonitor timing flakes unchanged.

Rename script committed at tools/rename-to-scadabridge.sh.
2026-05-28 09:37:45 -04:00

58 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Tear down ScadaBridge test infrastructure.
#
# Drops the MSSQL data volume by default, so the ScadaBridgeConfig DB
# (templates, scripts, data connections, etc.) is wiped. Use
# infra/reseed.sh afterwards to restore the design state from
# infra/mssql/seed-config.sql.
#
# Usage:
# ./teardown.sh Stop containers and delete the SQL data volume
# ./teardown.sh --images Also remove downloaded Docker images
# ./teardown.sh --all Remove volumes, images, and the Python venv
set -euo pipefail
cd "$(dirname "$0")"
REMOVE_IMAGES=false
REMOVE_VENV=false
for arg in "$@"; do
case "$arg" in
--images) REMOVE_IMAGES=true ;;
--all) REMOVE_IMAGES=true; REMOVE_VENV=true ;;
-h|--help)
echo "Usage: ./teardown.sh [--images] [--all]"
echo " (no flags) Stop containers, delete SQL data volume"
echo " --images Also remove downloaded Docker images"
echo " --all Remove volumes, images, and Python venv"
exit 0
;;
*)
echo "Unknown option: $arg" >&2
exit 1
;;
esac
done
echo "Stopping containers and removing SQL data volume..."
if $REMOVE_IMAGES; then
docker compose down -v --rmi all
else
docker compose down -v
fi
if $REMOVE_VENV && [ -d tools/.venv ]; then
echo "Removing Python virtual environment..."
rm -rf tools/.venv
fi
echo ""
echo "Teardown complete."
echo ""
echo "To restore the full test cluster (infra + app + design seed + sites):"
echo " infra/reseed.sh"
echo ""
echo "To start only infra (no app, no seed):"
echo " cd infra && docker compose up -d"