AkurAI Build
Menu

AkurAI-Build

public

Latest change ce4b48cfe1decc20a4f7243fa2b30fb78a3e0f12 - worker: hourly stale-workspace pruning; writable-home sandbox docs by Ólafur Búi Ólafsson

#!/bin/sh
# Stage the freshly packaged akurai binary for the host deploy agent.
#
# CI jobs run inside the hardened akurai-build service (ReadOnlyPaths on the
# service binary and config, NoNewPrivileges), so they cannot swap the service
# binary or restart the unit
# themselves — and they cannot outlive the restart either, because the worker
# executing this job runs inside the very service being replaced. This job
# therefore hands off and exits: it stages the candidate plus its sha256 into
# the service data dir and the root-owned akurai-deploy.path unit (deploy/host/)
# verifies the checksum, installs, restarts, health-gates, and rolls back to
# the previous binary automatically if the service does not come up.
set -eu

staging="${AKURAI_DEPLOY_STAGING:-/home/olibuijr/.local/share/akurai-build/deploy-staging}"

test -x target/release/akurai
mkdir -p "$staging"
rm -f "$staging/result"

install -m 755 target/release/akurai "$staging/akurai.next"
sha256sum "$staging/akurai.next" | cut -d' ' -f1 > "$staging/request.tmp"
mv "$staging/request.tmp" "$staging/request"

printf '%s\n' "candidate staged; host agent will verify, install, restart, and health-gate with rollback"
exit 0