skillhub/scripts/tests/server-image-compat-test.sh
XiaoSeS aa4ea17c4a fix(deploy): preserve storage volume ownership
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
2026-08-29 15:58:55 +08:00

19 lines
678 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
DOCKERFILE="$REPO_ROOT/server/Dockerfile"
fail() {
echo "FAIL: $*" >&2
exit 1
}
grep -Fq 'groupadd --system --gid 101 app' "$DOCKERFILE" \
|| fail 'server runtime group must retain the v0.2.17 gid 101 for storage-volume upgrades'
grep -Fq 'useradd --system --uid 100 --gid app --create-home app' "$DOCKERFILE" \
|| fail 'server runtime user must retain the v0.2.17 uid 100 for storage-volume upgrades'
grep -Eq '^USER app[[:space:]]*$' "$DOCKERFILE" \
|| fail 'server runtime must continue to run as the non-root app user'
echo 'server-image-compat-test passed'