Add MQTT enrollment demo with Gitea deploy pipeline
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>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
# Waits for both simulated boards to finish and fails unless each exited with code 0
|
||||
# (exit code 0 = all 19 checks passed). Used by the deploy pipeline after "compose up".
|
||||
set -eu
|
||||
PROJECT=${COMPOSE_PROJECT_NAME:-crypto-interop-spike}
|
||||
TIMEOUT=${VERIFY_TIMEOUT:-300}
|
||||
|
||||
waited=0
|
||||
while :; do
|
||||
done_count=0
|
||||
for svc in board-c board-cpp; do
|
||||
cid=$(docker ps -aq --filter "label=com.docker.compose.project=$PROJECT" --filter "label=com.docker.compose.service=$svc")
|
||||
[ -n "$cid" ] || { echo "container for $svc not found" >&2; exit 1; }
|
||||
[ "$(docker inspect -f '{{.State.Status}}' "$cid")" = exited ] && done_count=$((done_count + 1))
|
||||
done
|
||||
[ "$done_count" = 2 ] && break
|
||||
[ "$waited" -ge "$TIMEOUT" ] && { echo "timed out after ${TIMEOUT}s waiting for the boards" >&2; exit 1; }
|
||||
sleep 5
|
||||
waited=$((waited + 5))
|
||||
done
|
||||
|
||||
status=0
|
||||
for svc in board-c board-cpp; do
|
||||
cid=$(docker ps -aq --filter "label=com.docker.compose.project=$PROJECT" --filter "label=com.docker.compose.service=$svc")
|
||||
code=$(docker inspect -f '{{.State.ExitCode}}' "$cid")
|
||||
echo "$svc exit code: $code"
|
||||
docker logs "$cid" 2>&1 | grep -E 'RESULT|FAIL' || true
|
||||
[ "$code" = 0 ] || status=1
|
||||
done
|
||||
exit "$status"
|
||||
Reference in New Issue
Block a user