From a79053e75d372948b1044094b8b2c8bcec350da6 Mon Sep 17 00:00:00 2001 From: Timur Gordon <31495328+timurgordon@users.noreply.github.com> Date: Tue, 4 Nov 2025 17:04:42 +0100 Subject: [PATCH] Add build.sh and run.sh scripts for self-contained build and execution - Each component now has its own build.sh that builds in release mode - Each component's run.sh calls build.sh first, then starts the service - Coordinator, supervisor, and runner scripts are self-contained - All scripts use RUSTFLAGS="-A warnings" to suppress build warnings - Scripts properly handle configuration via environment variables --- scripts/build.sh | 11 +++++++++++ scripts/run.sh | 23 +++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100755 scripts/build.sh create mode 100755 scripts/run.sh diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..2a2afdd --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +PROJECT_DIR=$(cd "$SCRIPT_DIR/.." && pwd) + +echo "Building Hero Coordinator..." +cd "$PROJECT_DIR" +RUSTFLAGS="-A warnings" cargo build --release + +echo "✅ Hero Coordinator built successfully" diff --git a/scripts/run.sh b/scripts/run.sh new file mode 100755 index 0000000..aec25c1 --- /dev/null +++ b/scripts/run.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +PROJECT_DIR=$(cd "$SCRIPT_DIR/.." && pwd) + +# Build first +"$SCRIPT_DIR/build.sh" + +# Configuration +REDIS_ADDR="${REDIS_ADDR:-127.0.0.1:6379}" +HTTP_PORT="${HTTP_PORT:-8081}" +WS_PORT="${WS_PORT:-9653}" +LOG_LEVEL="${LOG_LEVEL:-info}" + +echo "Starting Hero Coordinator..." +cd "$PROJECT_DIR" + +RUST_LOG="$LOG_LEVEL" RUST_LOG_STYLE=never \ +exec target/release/herocoordinator \ + --redis-addr "$REDIS_ADDR" \ + --api-http-port "$HTTP_PORT" \ + --api-ws-port "$WS_PORT"