Fix the first deploy: Access audience parsing and smoke test wait (#2)
* Fix bootstrap reading the Access app's audience
${WEB_APP:-{}} expands to the JSON plus a stray closing brace, so jq
failed and stopped the first deploy right after creating the Access app.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AizKXSsengXZRegJxRATkL
* Give the deploy smoke test time for the first certificate
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AizKXSsengXZRegJxRATkL
---------
Co-authored-by: Claude <noreply@anthropic.com>Canberk Demirci authored · GitHub committed signed1 parent 5387f79commit d77e9f67e31281610bdf844e06898f08db444c26Browse files
2 files changed+3−2
modified.github/workflows/deploy.yml+2−1View file
| @@ -59,7 +59,8 @@ | ||
| 59 | 59 | |
| 60 | 60 | - name: Smoke test |
| 61 | 61 | run: | |
| 62 | - for i in 1 2 3 4 5 6; do | |
| 62 | + # A new custom domain can take a few minutes to get its certificate. | |
| 63 | + for i in $(seq 1 30); do | |
| 63 | 64 | code=$(curl -s -o /dev/null -w '%{http_code}' https://diffinery.com/healthz) && [ "$code" = 200 ] && exit 0 |
| 64 | 65 | sleep 10 |
| 65 | 66 | done |
modifiedscripts/bootstrap.sh+1−1View file
| @@ -99,7 +99,7 @@ | ||
| 99 | 99 | WEB_APP="$(cf PUT "/access/apps/$WEB_ID" "$WEB_BODY" | jq -c '.result // empty')" |
| 100 | 100 | [[ -n "$WEB_APP" ]] && echo "Access app covers $DOMAIN/auth/access" || warn "Could not update the Access application." |
| 101 | 101 | fi |
| 102 | - AUD="$(jq -r '.aud // empty' <<<"${WEB_APP:-{}}")" | |
| 102 | + AUD="$(jq -r '.aud // empty' <<<"${WEB_APP:-null}")" | |
| 103 | 103 | |
| 104 | 104 | # Earlier versions put Access in front of the whole site and needed a bypass app; remove it. |
| 105 | 105 | BYPASS_ID="$(jq -r '.result[] | select(.name=="Diffinery machine endpoints") | .id' <<<"$APPS" | head -n1)" |