carlos / todomvc-bakeoff Public

Clone
git clone https://amadan.net/carlos/todomvc-bakeoff

Plain git — no account needed to clone.

Download

Download this file

1#!/usr/bin/env bash
2# Gives one app an empty database before it is measured. Deleting an
3# instance parks its data, and the hostname can't be reused until an
4# operator purges it, so this runs in two steps:
5# scripts/fresh-instance.sh delete <slug> then an operator purges the host
6# scripts/fresh-instance.sh create <slug> recreate, wait for the recorded version
7# Bakeoff test data only. Paul's call, 2026-10-24.
8set -euo pipefail
9step=$1 slug=$2
10cd "$(dirname "$0")/.."
11app=todo-$slug host=todo-$slug.bfj.oncarlos.com
12want=$(python3 -c "import json; print(json.load(open('results/$slug.json'))['Version'])")
13if [ "$step" = delete ]; then
14 carlos instances delete --account bfj --app "$app" --host "$host" --message "Empty the database before measuring (bakeoff)"
15 exit 0
16fi
17carlos instances create --account bfj --app "$app" --host "$host" --channel edge --message "Recreate with an empty database (bakeoff)"
18for _ in $(seq 1 60); do
19 got=$(curl -s --max-time 10 "https://$host/api/version" || true)
20 [ "$got" = "$want" ] && { echo "$slug: fresh instance serving $got"; carlos instances list --account bfj --app "$app" | tail -1; exit 0; }
21 sleep 5
22done
23echo "$slug: fresh instance not serving $want after 5 minutes (last: $got)" >&2
24exit 1
25