photoncloud-monorepo/docs/por/T035-vm-integration-test/build-all-services.sh
centra 5c6eb04a46 T036: Add VM cluster deployment configs for nixos-anywhere
- netboot-base.nix with SSH key auth
- Launch scripts for node01/02/03
- Node configuration.nix and disko.nix
- Nix modules for first-boot automation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 09:59:19 +09:00

68 lines
1.9 KiB
Bash
Executable file

#!/usr/bin/env bash
# T035 Option 3: Build all PlasmaCloud service binaries
# Each service is in its own workspace with its own Cargo.toml
set -euo pipefail
BASE_DIR="/home/centra/cloud"
echo "=== T035 S2: Building all PlasmaCloud service binaries ==="
echo "Building in release mode for integration testing..."
echo ""
# Service definitions: directory and package name
declare -A SERVICES=(
["chainfire"]="chainfire-server"
["flaredb"]="flaredb-server"
["iam"]="iam-server"
["plasmavmc"]="plasmavmc-server"
["novanet"]="novanet-server"
["flashdns"]="flashdns-server"
["fiberlb"]="fiberlb-server"
["lightningstor"]="lightningstor-server"
["k8shost"]="k8shost-server"
["metricstor"]="metricstor-server"
)
# Build each service in its workspace
BUILT=0
FAILED=0
for dir in "${!SERVICES[@]}"; do
pkg="${SERVICES[$dir]}"
echo "Building $pkg in $dir workspace..."
if cd "$BASE_DIR/$dir" && nix develop "$BASE_DIR" -c cargo build --release -p "$pkg" 2>&1 | grep -E "(Compiling|Finished|error:)" | tail -5; then
echo "$pkg: BUILD SUCCESS"
((BUILT++))
else
echo "$pkg: BUILD FAILED"
((FAILED++))
fi
echo ""
done
echo ""
echo "=== Build Summary ==="
echo "Checking for built binaries in target/release/..."
# Verify binaries exist
for dir in "${!SERVICES[@]}"; do
pkg="${SERVICES[$dir]}"
# Binary name is typically the package name with -server removed or kept
binary_name1="${pkg%-server}"
binary_name2="$pkg"
if [ -f "$BASE_DIR/$dir/target/release/$binary_name1" ]; then
echo "$pkg: $BASE_DIR/$dir/target/release/$binary_name1"
elif [ -f "$BASE_DIR/$dir/target/release/$binary_name2" ]; then
echo "$pkg: $BASE_DIR/$dir/target/release/$binary_name2"
else
echo "$pkg: BINARY NOT FOUND"
fi
done
echo ""
echo "Total: $BUILT built, $FAILED failed out of ${#SERVICES[@]}"
exit $FAILED