Go backend plus C (libsodium) and C++ (OpenSSL) simulated boards enroll through a Mosquitto 2.1 broker with Dynamic Security using X25519/HKDF/ Ed25519; a web view shows the run live. The Gitea workflow validates and builds the images, redeploys the stack on the server with the viewer on port 8099 and fails unless both boards pass all checks. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
37 lines
1.2 KiB
Bash
37 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
# Builds and starts the demo, streams the logs live until both boards finish, then shows the
|
|
# result of each board and tears everything down.
|
|
set -uo pipefail
|
|
cd "$(dirname "$0")"
|
|
EXITDIR=$(mktemp -d)
|
|
|
|
# compose.restart.yaml enables the "Run again" button (mounts the Docker socket; local use only).
|
|
export COMPOSE_FILE=compose.yaml:compose.restart.yaml
|
|
docker compose up --build -d || exit 1
|
|
echo
|
|
echo ">>> Live web view: http://localhost:8099 (open it now; the programs start after their countdown)"
|
|
echo
|
|
docker compose logs -f &
|
|
LOGS_PID=$!
|
|
|
|
# Wait for both boards to exit (they run: start delay, steps, then exit with 0 = all checks passed).
|
|
for svc in board-c board-cpp; do
|
|
docker wait "$(docker compose ps -aq "$svc")" > "$EXITDIR/$svc.exit"
|
|
done
|
|
sleep 1
|
|
kill "$LOGS_PID" 2>/dev/null
|
|
|
|
echo
|
|
echo "================ RESULT ================"
|
|
status=0
|
|
for svc in board-c board-cpp; do
|
|
code=$(cat "$EXITDIR/$svc.exit")
|
|
echo "$svc exit code: $code"
|
|
[ "$code" = "0" ] || status=1
|
|
done
|
|
[ $status = 0 ] && echo "ALL CHECKS PASSED" || echo "FAILURES (see logs above)"
|
|
|
|
echo
|
|
echo "Containers are still up for inspection. Stop with: docker compose -f $(pwd)/compose.yaml down"
|
|
exit $status
|