tool(app): capture, full-check and preview-publish scripts for the Flutter pipelines
This commit is contained in:
@@ -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)"
|
||||
Reference in New Issue
Block a user