From e89c2290de133104420b02da3b7453a25484429d Mon Sep 17 00:00:00 2001 From: Lena Date: Wed, 1 Jul 2026 00:00:00 +0000 Subject: test: derive the docker image tag from the rig inputs The tag suffix had to be bumped by hand whenever the Dockerfile or sdk-packages.txt changed; forgetting meant silently testing against a stale image. Hash the two files into the tag so any edit invalidates the cache automatically. --- test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test b/test index d6475d6..de6eaf6 100755 --- a/test +++ b/test @@ -16,9 +16,9 @@ set -eu ROOT="$(cd "$(dirname "$0")" && pwd)" -# Bump the tag suffix whenever test-rig/Dockerfile or sdk-packages.txt -# changes; otherwise a stale cached image keeps being used. -IMG="scrcpy-android-test:5" +# The image tag is a hash of the rig inputs, so editing the Dockerfile +# or the SDK package list automatically invalidates the cached image. +IMG="scrcpy-android-test:$(cat "$ROOT/test-rig/Dockerfile" "$ROOT/test-rig/sdk-packages.txt" | sha256sum | cut -c1-12)" cmd="${1:-unit}" case "$cmd" in -- cgit v1.2.3