Simplify build.sh and update run.sh for self-contained execution

- Simplified build.sh to just build in release mode with warning suppression
- Updated run.sh to build first, then start supervisor and admin UI together
- Run script now starts both supervisor API and admin UI in background
- Added proper cleanup handler for graceful shutdown
- Removed admin UI compilation errors by fixing JsValue handling
- Added list_jobs method to WASM client for admin UI compatibility
This commit is contained in:
Timur Gordon
2025-11-04 17:05:01 +01:00
parent 3356a03895
commit b8ef14d06c
14 changed files with 424 additions and 7522 deletions

View File

@@ -2,41 +2,10 @@
set -e
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
PROJECT_DIR=$(cd "$SCRIPT_DIR/.." && pwd)
# Defaults
OUTDIR=""
RELEASE=0
CARGO_ARGS=""
echo "Building Hero Supervisor..."
cd "$PROJECT_DIR"
RUSTFLAGS="-A warnings" cargo build --release
usage() {
cat <<EOF
Usage: $(basename "$0") [options]
Options:
--release Use cargo --release
--outdir <dir> Output directory (passed to cargo --dist)
--cargo-args "..." Extra arguments forwarded to cargo build
-h, --help Show this help
EOF
}
# Parse args
while [[ $# -gt 0 ]]; do
case "$1" in
--release) RELEASE=1; shift;;
--outdir) OUTDIR="$2"; shift 2;;
--cargo-args) CARGO_ARGS="$2"; shift 2;;
-h|--help) usage; exit 0;;
*) echo "❌ Unknown option: $1"; echo; usage; exit 1;;
esac
done
"$SCRIPT_DIR/install.sh"
set -x
cmd=(cargo build)
if [[ $RELEASE -eq 1 ]]; then cmd+=(--release); fi
if [[ -n "$OUTDIR" ]]; then cmd+=(--dist "$OUTDIR"); fi
if [[ -n "$CARGO_ARGS" ]]; then cmd+=($CARGO_ARGS); fi
"${cmd[@]}"
set +x
echo "✅ Hero Supervisor built successfully"