fix: convert bash array to POSIX for-loop in caddyfile-routing-test
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/edge-subpath Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful

Step ran in alpine:3.19 with default /bin/sh (busybox ash) which does not
support bash array syntax. REQUIRED_HANDLERS=(...) + "${ARR[@]}" failed
with "syntax error: unexpected (".

Inlined the handler list into a single space-separated for-loop that works
under POSIX sh. No behavioral change; same 6 handlers checked.

Fixes edge-subpath/caddyfile-routing-test exit 2 on pipelines targeting
fix/issue-1025-3 — see #1025.
This commit is contained in:
disinto-admin 2026-04-20 10:47:12 +00:00
parent 181f82dfd0
commit 48ce3edb4b

View file

@ -130,17 +130,9 @@ steps:
echo "=== Validating Caddyfile routing blocks ===" echo "=== Validating Caddyfile routing blocks ==="
# Check that all required subpath handlers exist # Check that all required subpath handlers exist
REQUIRED_HANDLERS=( # POSIX-safe loop (alpine /bin/sh has no arrays)
"handle /forge/\*"
"handle /ci/\*"
"handle /staging/\*"
"handle /chat/login"
"handle /chat/oauth/callback"
"handle /chat/\*"
)
FAILED=0 FAILED=0
for handler in "$${REQUIRED_HANDLERS[@]}"; do for handler in "handle /forge/\*" "handle /ci/\*" "handle /staging/\*" "handle /chat/login" "handle /chat/oauth/callback" "handle /chat/\*"; do
if grep -q "$handler" "$CADDYFILE"; then if grep -q "$handler" "$CADDYFILE"; then
echo "[PASS] Found handler: $handler" echo "[PASS] Found handler: $handler"
else else