fix(ci): pass gate pages to the curl container as arguments
ci-staging-gate.sh spliced $ALL_PAGES into the sh -c script text. The English page list from Entrypoint.swift is newline-separated, so the newline ended the `for p in` list early and sh failed with "unexpected word (expecting do)" before any page was requested (run 384, job 948). Pass the pages as positional arguments and the relay host as an env var. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e1c341f302
commit
da7df5fed1
@@ -83,12 +83,15 @@ PAGE_COUNT=$(echo "$PAGES" | wc -w | tr -d ' ')
|
||||
ES_PAGES=$(ls "$SRC/Resources/Views/es/" 2>/dev/null | sed 's/\.leaf$//' | grep -v '^landing$' | sed 's|^|es/|' | tr '\n' ' ')
|
||||
ALL_PAGES="donate releases $PAGES es/ $ES_PAGES"
|
||||
echo "GATE: rendering $(echo "$ALL_PAGES" | wc -w | tr -d ' ') public pages"
|
||||
# One curl container for the whole list, not one per page.
|
||||
BAD=$(docker run --rm --network "$NET" --entrypoint sh "$CURL_IMAGE" -c '
|
||||
for p in '"$ALL_PAGES"'; do
|
||||
c=$(curl -s -m 5 -o /dev/null -w "%{http_code}" "http://'"${STACK}"'-relay:8080/$p")
|
||||
# One curl container for the whole list, not one per page. The pages go in as
|
||||
# arguments: $PAGES is newline-separated, and spliced into the script text a
|
||||
# newline ends the `for ... in` list early (sh: unexpected word, run 384).
|
||||
# shellcheck disable=SC2086 # word splitting of $ALL_PAGES is intended
|
||||
BAD=$(docker run --rm --network "$NET" -e RELAY="${STACK}-relay" --entrypoint sh "$CURL_IMAGE" -c '
|
||||
for p in "$@"; do
|
||||
c=$(curl -s -m 5 -o /dev/null -w "%{http_code}" "http://$RELAY:8080/$p")
|
||||
[ "$c" = 200 ] || echo "/$p=$c"
|
||||
done')
|
||||
done' sh $ALL_PAGES)
|
||||
[ -z "$BAD" ] || fail "pages not 200: $BAD"
|
||||
|
||||
echo "GATE: stability window (${WINDOW}s)"
|
||||
|
||||
Reference in New Issue
Block a user