scripts/sacmesh-deploy.sh deploys a tagged fork release to SacMesh's two CoreScope instances on Borguntu:
| Instance | Directory | Services restarted | Health check |
|---|---|---|---|
| WAN (wan.sacmesh.org) | ~/code/corescope-mqtt |
ingestor, server |
http://10.20.0.10:18082/api/health |
| scope (scope.sacmesh.org) | ~/services/sacscope |
corescope |
http://127.0.0.1:18083/api/health |
git fetch kesh --tags && git checkout v3.19.0+sacmesh.5
scripts/sacmesh-deploy.sh --dry-run both # build the images only
scripts/sacmesh-deploy.sh both # wan first, then scopeIt calls sudo for docker and for scope's server binary, so run it from a terminal. Without one (an agent), give sudo an askpass helper: put a sudo shim that runs /usr/bin/sudo -A "$@" first on PATH and set SUDO_ASKPASS.
go, zig (for the static musl build; pip install ziglang in a venv plus a zig wrapper on PATH works), docker through sudo, curl and python3 must be available. WAN_DIR, SCOPE_DIR, WAN_HEALTH, SCOPE_HEALTH, HEALTH_TIMEOUT (seconds, default 300) and DOCKER (default sudo docker) override the defaults.
- Refuses a dirty checkout, a HEAD that is not exactly on a
v*+sacmesh.Ntag, or an instance that is unhealthy before it starts. Skips an instance already on the commit. - Builds the static ingestor and server once (
make crossbuild-*-linux-amd64). - Per instance: stages the binaries,
public/,.git-commit,.image-versionand a DockerfileFROMthe image the instance runs now (WAN:deploy/wan-<version>-<time>/; scope:build-<version>-<commit>/), and buildscorescope:wan-<version>-<commit>orsacmesh-scope-picker:<version>-<commit>. - Backs up
compose.yaml(and scope's bind-mountedcaddy/operator-release/corescope-server) as*.before-<version>-<time>, points compose at the new image, installs scope's server as1000:1000mode 500 (root-owned, the container cannot run it), and restarts only the CoreScope services with--no-deps. - Waits for
/api/healthto report the new commit and checks/api/packets. On any failure it restores the backups, restarts, and waits for the old commit. - Writes the rollback steps to
ROLLBACK.txtin the staging folder.
- Database migrations,
config.jsonedits or new compose settings. A release that needs any of these gets its own plan, a DB backup and a tested rollback first; the automatic rollback only restores binaries and the image. - The instance READMEs and the NAS
AGENTS.mdapproval note: add the release section by hand after the deploy. - Clean up images: each release is a layer on the previous one. Prune old
corescope:wan-*andsacmesh-scope-picker:*tags once the release has run for a while.