Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history

verify-deploy.sh

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

verify-deploy.shBlame68 lines · 1 contributor
6d2b36eDictation App1#!/usr/bin/env bash
2# Post-deploy smoke verifier. Runs the DEPLOY_CHECKLIST.md post-deploy
3# smoke tests as a single command. Exits non-zero on any failure so it
4# can be dropped into CI or a post-deploy hook.
5#
6# Usage:
7# bash scripts/verify-deploy.sh # defaults to https://gluecron.com
8# bash scripts/verify-deploy.sh https://staging.example # override base URL
9# BASE_URL=https://gluecron.com bash scripts/verify-deploy.sh
10
11set -uo pipefail
12
13BASE_URL="${1:-${BASE_URL:-https://gluecron.com}}"
14BASE_URL="${BASE_URL%/}"
15
16fail=0
17
18check() {
19 local label="$1"
20 local url="$2"
21 local expect_status="${3:-200}"
22 local match="${4:-}"
23
24 local tmp status body
25 tmp="$(mktemp)"
26 status="$(curl -sS -o "$tmp" -w '%{http_code}' --max-time 10 "$url" || echo 000)"
27 body="$(cat "$tmp")"
28 rm -f "$tmp"
29
30 if [[ "$status" != "$expect_status" ]]; then
31 printf ' \033[31mFAIL\033[0m %-32s %s (got %s, want %s)\n' \
32 "$label" "$url" "$status" "$expect_status"
33 fail=$((fail + 1))
34 return
35 fi
36
37 if [[ -n "$match" && "$body" != *"$match"* ]]; then
38 printf ' \033[31mFAIL\033[0m %-32s %s (body missing %q)\n' \
39 "$label" "$url" "$match"
40 fail=$((fail + 1))
41 return
42 fi
43
44 printf ' \033[32mOK\033[0m %-32s %s (%s)\n' "$label" "$url" "$status"
45}
46
47echo "Verifying $BASE_URL ..."
48
49check "healthz" "$BASE_URL/healthz" 200
50check "readyz" "$BASE_URL/readyz" 200
51check "status (html)" "$BASE_URL/status" 200 "status"
52check "status.svg" "$BASE_URL/status.svg" 200 "<svg"
53check "metrics" "$BASE_URL/metrics" 200 "# HELP"
54check "landing (/)" "$BASE_URL/" 200
55
56# www alias — only runs when the base URL has no www and is HTTPS
57if [[ "$BASE_URL" =~ ^https://[^/]+$ ]] && [[ ! "$BASE_URL" =~ https://www\. ]]; then
58 www_url="${BASE_URL/https:\/\//https:\/\/www.}"
59 check "www alias /healthz" "$www_url/healthz" 200
60fi
61
62if [[ "$fail" -eq 0 ]]; then
63 printf '\n\033[32mAll checks passed.\033[0m\n'
64 exit 0
65fi
66
67printf '\n\033[31m%d check(s) failed.\033[0m\n' "$fail"
68exit 1