#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TEST_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"

compose() {
  if docker compose version >/dev/null 2>&1; then
    docker compose "$@"
  else
    docker-compose "$@"
  fi
}

echo "[INFO] Bringing up system stack..."
pushd "$TEST_ROOT" >/dev/null
compose -p argus-sys down --remove-orphans || true
compose -p argus-sys up -d
popd >/dev/null

echo "[OK] Services started: master:32300 es:9200 kibana:5601 node-a:2020 node-b:2021"

