argus/deployment/build/build_cpu_node_image.sh

40 lines
996 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd "$ROOT_DIR"
usage() {
cat <<EOF
Build CPU node-bundle image (wrapper)
Usage: $(basename "$0") [--client-version YYYYMMDD]
Examples:
$(basename "$0") --client-version 20251106
$(basename "$0") # auto-detect artifact version via packaging
EOF
}
VERSION=""
while [[ $# -gt 0 ]]; do
case "$1" in
--client-version) VERSION="${2:-}"; shift 2;;
-h|--help) usage; exit 0;;
*) echo "Unknown arg: $1" >&2; usage; exit 1;;
esac
done
CMD=("./deployment/build/build_images.sh" "--with-node-bundle")
if [[ -n "$VERSION" ]]; then CMD+=("--client-version" "$VERSION"); fi
echo "[CPU-BUNDLE] invoking: ${CMD[*]}"
"${CMD[@]}"
echo "[CPU-BUNDLE] built image: argus-sys-metric-test-node-bundle:latest"
docker image inspect argus-sys-metric-test-node-bundle:latest >/dev/null 2>&1 || {
echo "[ERR] expected image not found" >&2; exit 1; }
echo "[CPU-BUNDLE] done"