#!/usr/bin/env bash set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" DOCKER_SMOKE="${PLANET_HARNESS_DOCKER_SMOKE:-0}" run() { printf "+ %s\n" "$*" >&2 "$@" } run_helm_smoke_if_available() { if ! command -v helm >/dev/null 2>&1; then printf "warn: helm not found; skipping Helm lint/template smoke\n" return 0 fi run helm lint deploy/helm/planet run helm template planet-staging deploy/helm/planet \ --namespace planet-staging \ -f deploy/helm/planet/values.single-node.yaml \ --set image.tag=harness-smoke >/tmp/planet-harness-rendered.yaml } run_docker_smoke_if_requested() { case "$DOCKER_SMOKE" in 1|true|yes|on) ;; *) printf "info: Docker image smoke skipped; set PLANET_HARNESS_DOCKER_SMOKE=1 to enable\n" return 0 ;; esac if ! command -v docker >/dev/null 2>&1; then printf "fail: docker not found; cannot run requested image smoke builds\n" return 1 fi run docker build -t planet-harness/frontend:smoke ./frontend run docker build -t planet-harness/backend:smoke -f backend/Dockerfile . run docker build -t planet-harness/aiprovider:smoke -f aiprovider/Dockerfile . } main() { cd "$ROOT_DIR" run scripts/harness/quick-check.sh ( cd "$ROOT_DIR/frontend" run bun install --frozen-lockfile run bun run build ) run_helm_smoke_if_available run_docker_smoke_if_requested printf "harness validation passed\n" } main "$@"