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

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

# 准备离线依赖并构建镜像
pushd "$MASTER_ROOT" >/dev/null
./scripts/prepare_offline_wheels.sh --clean --pip-version 25.2
./scripts/build_images.sh --offline --tag argus-master:offline
popd >/dev/null

# 使用离线镜像执行既有端到端用例
MASTER_IMAGE_TAG="argus-master:offline" ./scripts/00_e2e_test.sh

