diff options
| author | cirakg <cirakg@cirakg.xyz> | 2026-10-18 21:10:37 +0200 |
|---|---|---|
| committer | cirakg <cirakg@cirakg.xyz> | 2026-10-18 21:10:37 +0200 |
| commit | 85f1ecabd7f58f306b2a042376209ac8cf49ab9b (patch) | |
| tree | 00a0f3e2717e5c20ce0c427a979ef609a400d326 /docker/scripts/sim-vnc.sh | |
| parent | 2071e2beda763137416ac386d4bb953711ec995d (diff) | |
build: complete the Docker pipeline for build, test, screenshots and packaging
- Container scripts now run from the mounted project (no image rebuild
per script change): build-app.sh (strict -l 3, warnings fail),
run-unit-tests.sh, screenshots.sh, app-diag.sh (perf/memory),
lint.sh, package.sh and sim-vnc.sh (noVNC on 127.0.0.1:6080).
- Headless simulator helpers: wait for port 1234, remove the stale
single-instance lock (~/Sim-dev) that made later starts hang, show
the simulator log on failure.
- New targets: screenshots-approve, icons; `make lock` re-adds the
requirements header; pytest treats warnings as errors.
- Author/Summary headers on every build file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docker/scripts/sim-vnc.sh')
| -rwxr-xr-x | docker/scripts/sim-vnc.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/docker/scripts/sim-vnc.sh b/docker/scripts/sim-vnc.sh new file mode 100755 index 0000000..207db09 --- /dev/null +++ b/docker/scripts/sim-vnc.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Author: cirakg & claude ai +# Summary: Run the app in the simulator and show the simulator in your browser through noVNC. +# +# Usage: sim-vnc.sh DEVICE (the Makefile publishes port 6080 on 127.0.0.1 only) +# View: http://127.0.0.1:6080/vnc.html, then "Connect". +# +# The VNC server listens only inside the container (localhost, no password); +# the only way in is the noVNC web socket that the Makefile publishes on your +# machine's 127.0.0.1. Stop with Ctrl-C. +set -euo pipefail +# shellcheck source=ciq-env.sh +source "$(dirname "${BASH_SOURCE[0]}")/ciq-env.sh" + +readonly VNC_PORT=5900 +readonly NOVNC_PORT=6080 + +device="${1:?usage: sim-vnc.sh DEVICE}" +ciq_require_sdk +ciq_require_key +build-app.sh debug "${device}" + +ciq_start_display +ciq_start_simulator +x11vnc -display "${DISPLAY}" -localhost -nopw -forever -shared -quiet -rfbport "${VNC_PORT}" \ + >/tmp/x11vnc.log 2>&1 & +websockify --web /usr/share/novnc "${NOVNC_PORT}" "localhost:${VNC_PORT}" >/tmp/websockify.log 2>&1 & + +cat >&2 <<EOF + + Simulator running with the app on ${device}. + Open http://127.0.0.1:${NOVNC_PORT}/vnc.html in your browser and press Connect. + The app's console output follows below. Press Ctrl-C to stop. + +EOF +monkeydo "${BUILD_DIR}/debug/${device}.prg" "${device}" +# monkeydo returns when the app exits; keep the simulator up until Ctrl-C. +log "the app exited; the simulator stays up until you press Ctrl-C" +wait |
