scripts/smoke-test.sh
Metadata
- Purpose: Automation script used in local development, CI, or deployment flow.
- Domain:
scripts - Language:
bash - Bytes: 4201
- Lines: 113
- Content hash (short):
5da3b43a - Source (start): scripts/smoke-test.sh:1
- Source (end): scripts/smoke-test.sh:113
Indexed Symbols
No indexed functions/methods detected in this file.
Markdown Headings (if applicable)
No markdown headings detected.
Source Preview
#!/usr/bin/env bash
set -euo pipefail
BASE_URL="${BASE_URL:-http://localhost:8080}"
WORKSPACE_ID="${ANCHOR_WORKSPACE_ID:-00000000-0000-4000-8000-000000000001}"
AUTH_HEADER="${AUTH_HEADER:-}"
CURL_HEADERS=(
-H "x-workspace-id: ${WORKSPACE_ID}"
-H "content-type: application/json"
)
if [[ -n "$AUTH_HEADER" ]]; then
CURL_HEADERS+=( -H "Authorization: ${AUTH_HEADER}" )
fi
request() {
local method="$1"
local path="$2"
local data="${3:-}"
local idem="${4:-}"
local args=( -sS -f -X "$method" "${BASE_URL}${path}" "${CURL_HEADERS[@]}" )
if [[ -n "$idem" ]]; then
args+=( -H "Idempotency-Key: ${idem}" )