tool(app): capture, full-check and preview-publish scripts for the Flutter pipelines

This commit is contained in:
2026-10-23 13:18:53 +01:00
parent 2c0d96637a
commit 9ff0bf2eeb
3 changed files with 95 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
# Publishes the app to the preview served from build/web, keeping a rollback.
#
# Usage (from app/ on main): sh tool/publish_preview.sh <name>
# Builds into build/web-next, then renames build/web to
# build/web-before-<name>-<epoch> and build/web-next to build/web, so the
# preview server never sees a half-written bundle. Prints the rollback
# directory and the new main.dart.js hash. Never restarts any server.
set -eu
name="${1:?usage: sh tool/publish_preview.sh <name>}"
FLUTTER="${FLUTTER:-/Users/alan/development/flutter/bin/flutter}"
"$FLUTTER" build web -o build/web-next
rollback="build/web-before-${name}-$(date +%s)"
if [ -d build/web ]; then mv build/web "$rollback"; fi
mv build/web-next build/web
echo "ROLLBACK $rollback"
echo "JS $(shasum build/web/main.dart.js | cut -c1-8)"