refactor: separate standalone and managed room configs
- veins → shunts rename - add cfg/standalone/ and cfg/<room>/ structure - remove old data/*.json (moved to cfg/<room>/data/) - update build.py and ctrl scripts
This commit is contained in:
@@ -2,21 +2,25 @@
|
||||
# Build soleprint for local development
|
||||
#
|
||||
# Usage:
|
||||
# ./build.sh # Build gen/ with default config
|
||||
# ./build.sh amar # Build gen/ with amar room config
|
||||
# ./build.sh # Build gen/standalone/
|
||||
# ./build.sh amar # Build gen/amar/
|
||||
# ./build.sh --all # Build all targets
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
CFG="${1:-}"
|
||||
TARGET="${1:-}"
|
||||
|
||||
if [ -n "$CFG" ]; then
|
||||
echo "Building with --cfg $CFG..."
|
||||
python build.py dev --cfg "$CFG"
|
||||
if [ "$TARGET" = "--all" ]; then
|
||||
echo "Building all targets..."
|
||||
python build.py dev --all
|
||||
elif [ -n "$TARGET" ]; then
|
||||
echo "Building gen/$TARGET/..."
|
||||
python build.py dev --cfg "$TARGET"
|
||||
else
|
||||
echo "Building soleprint..."
|
||||
echo "Building gen/standalone/..."
|
||||
python build.py dev
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Done. Run with: ./ctrl/start.sh"
|
||||
echo "Done. Run with: ./ctrl/start.sh [target]"
|
||||
|
||||
26
ctrl/logs.sh
26
ctrl/logs.sh
@@ -1,7 +1,29 @@
|
||||
#!/bin/bash
|
||||
# View soleprint logs
|
||||
#
|
||||
# Usage:
|
||||
# ./logs.sh # Logs for standalone
|
||||
# ./logs.sh amar # Logs for amar
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")/../gen"
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
docker compose logs -f "$@"
|
||||
TARGET="standalone"
|
||||
ARGS=""
|
||||
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
-*) ARGS="$ARGS $arg" ;;
|
||||
*) TARGET="$arg" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
GEN_DIR="gen/$TARGET"
|
||||
|
||||
if [ ! -d "$GEN_DIR" ]; then
|
||||
echo "$GEN_DIR not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$GEN_DIR"
|
||||
docker compose logs -f $ARGS
|
||||
|
||||
@@ -1,28 +1,32 @@
|
||||
#!/bin/bash
|
||||
# Start soleprint with Docker (for network access to other services)
|
||||
# Start soleprint with Docker
|
||||
#
|
||||
# Usage:
|
||||
# ./start.sh # Start in foreground
|
||||
# ./start.sh -d # Start detached
|
||||
# ./start.sh --build # Rebuild image first
|
||||
# ./start.sh # Start standalone
|
||||
# ./start.sh amar # Start amar
|
||||
# ./start.sh -d # Detached
|
||||
# ./start.sh amar -d # Start amar detached
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
# Ensure gen/ exists
|
||||
if [ ! -d "gen" ]; then
|
||||
echo "gen/ not found. Run ./ctrl/build.sh first"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd gen
|
||||
|
||||
TARGET="standalone"
|
||||
ARGS=""
|
||||
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
-d|--detach) ARGS="$ARGS -d" ;;
|
||||
--build) ARGS="$ARGS --build" ;;
|
||||
*) TARGET="$arg" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
GEN_DIR="gen/$TARGET"
|
||||
|
||||
if [ ! -d "$GEN_DIR" ]; then
|
||||
echo "$GEN_DIR not found. Run ./ctrl/build.sh $TARGET first"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$GEN_DIR"
|
||||
docker compose up $ARGS
|
||||
|
||||
15
ctrl/stop.sh
15
ctrl/stop.sh
@@ -1,7 +1,20 @@
|
||||
#!/bin/bash
|
||||
# Stop soleprint Docker container
|
||||
#
|
||||
# Usage:
|
||||
# ./stop.sh # Stop standalone
|
||||
# ./stop.sh amar # Stop amar
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")/../gen"
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
TARGET="${1:-standalone}"
|
||||
GEN_DIR="gen/$TARGET"
|
||||
|
||||
if [ ! -d "$GEN_DIR" ]; then
|
||||
echo "$GEN_DIR not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$GEN_DIR"
|
||||
docker compose down
|
||||
|
||||
Reference in New Issue
Block a user