Appearance
Build Scripts
The scripts/build/ directory contains all build pipelines and supporting code generators.
Overview
build/
├── all.sh Full build (server + ariadne)
├── server.sh Server build pipeline
├── bug-collector.sh Bug collector x64 build + deploy
├── keryx-status.sh keryx-status x64 build + deploy (notify host)
├── rtls-relay.sh rtls-relay x64 build + deploy (update host, RTLS field test)
├── ariadne.sh Ariadne build pipeline
├── generators/
│ ├── embeds.ts Static file and migration embed generator
│ ├── installer.ts CLI bundler and installer generator
│ ├── vm-tests.ts VM test bundler
│ └── offline-bundle.ts Offline artifact bundle packer
└── templates/
├── installer.sh Installer shell script template
└── vm.sh VM test shell script templateFull Build (all.sh)
Runs the complete build pipeline for both server and Ariadne:
bash
bun build
# or directly: bash scripts/build/all.shSteps:
- Run server tests (
bun testinserver/) - Run contract tests (
bun scripts/test/contracts.ts) - Build server binaries via
server.sh --server-only - Build Ariadne via
ariadne.sh
Server Build (server.sh)
Builds the web frontend, generates embeds, compiles Linux binaries, runs smoke tests, and optionally uploads.
bash
bun build:server
# or directly: bash scripts/build/server.shFlags:
--server-only— skip the upload step (used byall.sh)--skip-upload— skip the upload step--vm-test— run the VM test suite on the local VirtualBox VM against the offline bundle before anything is uploaded (passed bybun commit --vm)
Steps:
- Build web frontend (
bun build.ts --releaseinweb/) - Generate static embeds (
generators/embeds.ts) - Generate installer script (
generators/installer.ts) - Generate VM test script (
generators/vm-tests.ts) - Compile Linux binaries (arm64 + x64) with
bun build --compile - Generate offline tarball bundle (
generators/offline-bundle.ts) - Run binary smoke tests (
scripts/test/binary.sh) - Test and compile rtls-relay (
rtls-relay.sh --skip-upload), so a failing relay test stops the release before anything ships (unless upload skipped) - With
--vm-test: run the VM test suite on VirtualBox against the offline bundle; a failure stops the build before the docs, website and binaries are uploaded - Upload binaries and installer artifacts to the deploy server (unless skipped)
- Deploy bug-collector x64 via
bug-collector.sh(unless upload skipped) - Deploy keryx-status x64 via
keryx-status.shto the notify host (unless upload skipped) - Deploy rtls-relay x64 via
rtls-relay.sh --upload-onlywhenrtls-relay.serviceexists on the update host; a failure only warns (unless upload skipped)
Placement Planner DWG imports use system-installed conversion tools on the target server. The build pipeline does not package LibreDWG, rsvg-convert, or any DWG converter vendor archive.
Bug Collector Build (bug-collector.sh)
Compiles the Linux x64 bug-collector binary, uploads it to mnew.ssh, and restarts bug-collector.service.
bash
bash scripts/build/bug-collector.sh
bash scripts/build/bug-collector.sh --skip-uploadSee Bug Collector for systemd / sudoers setup.
keryx-status Build (keryx-status.sh)
Compiles the Linux x64 keryx-status binary, uploads it to mnew.ssh, and restarts keryx-status.service.
bash
bash scripts/build/keryx-status.sh
bash scripts/build/keryx-status.sh --skip-uploadSee keryx-status for systemd / sudoers / nginx setup. --server-only / --skip-upload on server.sh skips this deploy.
rtls-relay Build (rtls-relay.sh)
Tests and compiles the Linux x64 relay of the Theseus RTLS field test, uploads it to mnew.ssh, and restarts rtls-relay.service.
bash
bash scripts/build/rtls-relay.sh # test, compile, upload, restart
bash scripts/build/rtls-relay.sh --skip-upload # test + compile only
bash scripts/build/rtls-relay.sh --upload-only # upload the binary built before + restartSee RTLS relay for systemd / sudoers / nginx setup. --server-only / --skip-upload on server.sh skips both relay steps.
Ariadne Build (ariadne.sh)
Builds the Flutter app for both platforms.
bash
bun build:ariadne
# or directly: bash scripts/build/ariadne.shSteps:
- Fetch Flutter dependencies
- Run Flutter analyze
- Build Android App Bundle (AAB)
- Build iOS IPA (macOS only, requires Xcode signing)
- Copy artifacts to
releases/
Keryx Build
bun run build:keryx and bun run build:keryx-ipa (via scripts/release/keryx-shared.ts) copy signed artifacts to releases/keryx.aab and releases/Keryx.ipa. Prefer bun keryx or bun run release:keryx for a full analyze/test/verify pass.
Generators
generators/embeds.ts
Generates two files that embed assets into the compiled server binary:
server/src/static_embeds.ts— maps URL paths to web frontend files usingimport ... with { type: "file" }server/src/migration_embeds.ts— bundles database migration code for runtime execution
This runs automatically as part of server.sh, but can also be run standalone:
bash
bun scripts/build/generators/embeds.tsgenerators/installer.ts
Bundles the CLI TypeScript code (from scripts/cli/) into a single self-contained installer shell script:
- Uses
Bun.build()to bundlecli/main.tswith all dependencies - Reads the template from
templates/installer.sh - Replaces
###version###,###util.sh###, and###util.ts###placeholders - Writes the final
releases/installer.sh
generators/offline-bundle.ts
Packages release artifacts into a transferable offline bundle:
- Reads version and active brand metadata
- Collects
installer.sh,test-vm.sh, and architecture binaries - Writes
offline-manifest.jsonwith checksums and size metadata - Produces
releases/<brand>-offline-<version>.tar.gz
See Offline Installation for deployment workflow.
Templates
templates/installer.sh
Shell script template with placeholder markers that generators/installer.ts fills in at build time. Contains the installer logic for downloading and setting up SafeCall on a production server.