@@ -331,19 +331,107 @@ generate-clades:
331331verisimdb-up :
332332 @ echo " Starting gsa-verisimdb on port 8090..."
333333 cd container && podman compose -f selur-compose.toml up -d gsa-verisimdb
334- @ echo " VeriSimDB running at http://[::1] :8090"
334+ @ echo " VeriSimDB running at http://localhost :8090"
335335
336336# Stop the dedicated VeriSimDB instance
337337verisimdb-down :
338338 @ echo " Stopping gsa-verisimdb..."
339339 cd container && podman compose -f selur-compose.toml down gsa-verisimdb
340340
341+ # Build the VeriSimDB container image from source
342+ verisimdb-build :
343+ #!/usr/bin/env bash
344+ set -euo pipefail
345+ VERISIMDB_SRC=" ${VERISIMDB_SRC:- ../ nextgen-databases/ verisimdb} "
346+ if [ ! -d " $VERISIMDB_SRC /rust-core" ]; then
347+ echo " ERROR: VeriSimDB source not found at $VERISIMDB_SRC "
348+ echo " Set VERISIMDB_SRC to the verisimdb repo root"
349+ exit 1
350+ fi
351+ echo " Building gsa-verisimdb image from $VERISIMDB_SRC ..."
352+ # Create temp build context with VeriSimDB source
353+ BUILD_CTX=$( mktemp -d)
354+ trap ' rm -rf "$BUILD_CTX"' EXIT
355+ cp container/verisimdb/Containerfile " $BUILD_CTX /"
356+ cp -a " $VERISIMDB_SRC " " $BUILD_CTX /verisimdb-src"
357+ podman build -t gsa-verisimdb:latest -f " $BUILD_CTX /Containerfile" " $BUILD_CTX "
358+ echo " Built gsa-verisimdb:latest"
359+
360+ # Install Podman Quadlet units for VeriSimDB systemd integration
361+ quadlet-install :
362+ #!/usr/bin/env bash
363+ set -euo pipefail
364+ QUADLET_DIR=" ${HOME} /.config/containers/systemd"
365+ echo " Installing GSA quadlets to $QUADLET_DIR ..."
366+ mkdir -p " $QUADLET_DIR "
367+ cp container/verisimdb/gsa-verisimdb.container " $QUADLET_DIR /"
368+ cp container/verisimdb-backup/gsa-verisimdb-backup.container " $QUADLET_DIR /"
369+ systemctl --user daemon-reload
370+ echo " Quadlets installed. Start with:"
371+ echo " systemctl --user start gsa-verisimdb"
372+ echo " systemctl --user start gsa-verisimdb-backup"
373+
374+ # Remove Podman Quadlet units
375+ quadlet-remove :
376+ #!/usr/bin/env bash
377+ set -euo pipefail
378+ QUADLET_DIR=" ${HOME} /.config/containers/systemd"
379+ echo " Stopping GSA services..."
380+ systemctl --user stop gsa-verisimdb-backup 2> /dev/null || true
381+ systemctl --user stop gsa-verisimdb 2> /dev/null || true
382+ echo " Removing quadlet files..."
383+ rm -f " $QUADLET_DIR /gsa-verisimdb.container"
384+ rm -f " $QUADLET_DIR /gsa-verisimdb-backup.container"
385+ systemctl --user daemon-reload
386+ echo " Quadlets removed."
387+
388+ # Full VeriSimDB deployment: build image → install quadlets → start
389+ verisimdb-deploy :
390+ #!/usr/bin/env bash
391+ set -euo pipefail
392+ echo " ═══════════════════════════════════════════════════"
393+ echo " GSA VeriSimDB Deployment Pipeline"
394+ echo " ═══════════════════════════════════════════════════"
395+ just verisimdb-build
396+ just quadlet-install
397+ echo " "
398+ echo " Starting VeriSimDB services..."
399+ systemctl --user start gsa-verisimdb
400+ # Wait for main instance health before starting backup
401+ echo " Waiting for main instance health..."
402+ for i in $( seq 1 10) ; do
403+ if curl -sf http://[::1]:8090/health > /dev/null 2>&1 ; then
404+ echo " Main instance healthy!"
405+ break
406+ fi
407+ [ " $i " -eq 10 ] && echo " WARNING: Main instance not healthy after 10s"
408+ sleep 1
409+ done
410+ systemctl --user start gsa-verisimdb-backup
411+ echo " "
412+ echo " Deployment complete:"
413+ systemctl --user status gsa-verisimdb --no-pager 2> /dev/null | head -5 || true
414+ systemctl --user status gsa-verisimdb-backup --no-pager 2> /dev/null | head -5 || true
415+
416+ # Check VeriSimDB systemd service status
417+ verisimdb-status :
418+ #!/usr/bin/env bash
419+ echo " Main VeriSimDB (port 8090):"
420+ systemctl --user status gsa-verisimdb --no-pager 2> /dev/null || echo " Not installed"
421+ echo " "
422+ echo " Backup VeriSimDB (port 8091):"
423+ systemctl --user status gsa-verisimdb-backup --no-pager 2> /dev/null || echo " Not installed"
424+ echo " "
425+ echo " Health checks:"
426+ curl -sf http://[::1]:8090/health && echo " ← main (8090)" || echo " main (8090): unreachable"
427+ curl -sf http://[::1]:8091/health && echo " ← backup (8091)" || echo " backup (8091): unreachable"
428+
341429# Launch the Gossamer GUI
342- gui :
343- @ echo " Launching Game Server Admin GUI ..."
344- GSA_VERISIMDB_URL=" ${GSA_VERISIMDB_URL:-http://[::1] :8090}" \
430+ gui : build-ffi
431+ @ echo " Launching Game Server Admin..."
432+ GSA_VERISIMDB_URL=" ${GSA_VERISIMDB_URL:-http://localhost :8090}" \
345433 GSA_PROFILES_DIR=" ${GSA_PROFILES_DIR:-./profiles}" \
346- ./ src/ interface/ ffi/ zig-out/ bin/ gsa
434+ ./ src/ interface/ ffi/ zig-out/ bin/ gsa status
347435
348436# Test probe engine against known ports
349437test-probe :
@@ -369,26 +457,34 @@ profile-count:
369457# TEST & QUALITY
370458# ═══════════════════════════════════════════════════════════════════════════════
371459
372- # Run all tests
460+ # Run all tests (unit + integration)
373461test * args :
374- @ echo " Running tests..."
375- # TODO: Replace with your test command
376- # Examples:
377- # cargo test {{args}}
378- # mix test {{args}}
379- # zig build test {{args}}
380- # deno test {{args}}
381- @ echo " Tests passed!"
462+ @ echo " Running Zig unit tests..."
463+ cd src/ interface/ ffi && zig build test {{ args}}
464+ @ echo " Running Zig integration tests..."
465+ cd src/ interface/ ffi && zig build test-integration {{ args}}
466+ @ echo " All tests passed!"
382467
383468# Run tests with verbose output
384469test-verbose :
385470 @ echo " Running tests (verbose)..."
386- # TODO: Replace with verbose test command
471+ cd src / interface / ffi && zig build test 2 >& 1
387472
388- # Smoke test
473+ # Smoke test — quick sanity: build + unit tests + profile count
389474test-smoke :
390- @ echo " Smoke test..."
391- # TODO: Add basic sanity checks
475+ #!/usr/bin/env bash
476+ set -euo pipefail
477+ FFI_DIR=" src/interface/ffi"
478+ echo " Smoke test: build FFI..."
479+ (cd " $FFI_DIR " && zig build)
480+ echo " Smoke test: unit tests..."
481+ (cd " $FFI_DIR " && zig build test)
482+ echo " Smoke test: smoke suite..."
483+ (cd " $FFI_DIR " && zig build test-smoke)
484+ PROFILES=$( ls profiles/* .a2ml 2> /dev/null | wc -l)
485+ echo " Smoke test: $PROFILES game profiles found"
486+ [[ " $PROFILES " -ge 1 ]] || { echo " FAIL: No game profiles" ; exit 1; }
487+ echo " Smoke test passed!"
392488
393489# Run all quality checks
394490quality : fmt-check lint test
@@ -435,14 +531,16 @@ lint:
435531# ═══════════════════════════════════════════════════════════════════════════════
436532
437533# Run the application
438- run * args : build
439- # TODO: Replace with your run command
440- echo " Run not configured yet"
534+ run * args : build-ffi
535+ GSA_VERISIMDB_URL=" ${GSA_VERISIMDB_URL:-http://localhost:8090}" \
536+ GSA_PROFILES_DIR=" ${GSA_PROFILES_DIR:-./profiles}" \
537+ ./ src/ interface/ ffi/ zig-out/ bin/ gsa {{ args}}
441538
442539# Run with verbose output
443- run-verbose * args : build
444- # TODO: Replace with verbose run command
445- echo " Run not configured yet"
540+ run-verbose * args : build-ffi
541+ GSA_VERISIMDB_URL=" ${GSA_VERISIMDB_URL:-http://localhost:8090}" \
542+ GSA_PROFILES_DIR=" ${GSA_PROFILES_DIR:-./profiles}" \
543+ ./ src/ interface/ ffi/ zig-out/ bin/ gsa {{ args}}
446544
447545# Install to user path
448546install : build-release
0 commit comments