Files
roro9stack/scripts/_docker.sh
T
twislaandClaude Opus 5.5 db7e6ccc18
CI / build (push) Successful in 8m5s
CI: jobs run in a container, PlatformIO directly in it, the toolchains in a volume
The runner now gives each job a container. The workflow asks for
python:3.12-slim, installs git, a compiler and PlatformIO, and mounts the
roro9stack-pio volume as the cache; the scripts skip their own docker run
when RORO_NO_DOCKER says they're in the build container already. A tag
from before the framework was rebuilt gets the stock framework libraries
back before it builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
2026-10-06 12:39:37 +02:00

29 lines
1.1 KiB
Bash
Executable File

# Shared helper: run a command inside the roro9stack build container.
# With RORO_NO_DOCKER set, the caller is in such a container already (a CI job): the command runs
# right here, in the checkout.
IMAGE=roro9stack-build
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
[ -n "${RORO_NO_DOCKER:-}" ] || docker build -q -t "$IMAGE" "$ROOT/docker" >/dev/null
# The Debug Console token (ADR 0004): made once, kept with the OTA key, never committed.
DEBUG_TOKEN_FILE="$HOME/.config/roro9stack/debug-token"
if [ ! -s "$DEBUG_TOKEN_FILE" ]; then
mkdir -p "$(dirname "$DEBUG_TOKEN_FILE")"
(umask 077 && od -An -tx1 -N16 /dev/urandom | tr -d ' \n' > "$DEBUG_TOKEN_FILE")
fi
run_in_container() {
if [ -n "${RORO_NO_DOCKER:-}" ]; then
(cd "$ROOT" && RORO_DEBUG_TOKEN="$(cat "$DEBUG_TOKEN_FILE")" "$@")
return
fi
docker run --rm \
-u "$(id -u):$(id -g)" -e HOME=/tmp \
-e RORO_DEBUG_TOKEN="$(cat "$DEBUG_TOKEN_FILE")" \
-v "$ROOT:/work" \
-v roro9stack-pio:/pio \
"${DOCKER_EXTRA[@]}" \
"$IMAGE" "$@"
}