#!/bin/sh # Build the coordinator and the worker from one commit, with one stamp, so a # burn-in run can never pair a new coordinator with an old worker. Both # binaries then report the same revision at /v1/admin/diagnostics and in the # worker's registration, which is what makes deployed identity evidence rather # than assumption. # # Usage: deploy/build.sh [outdir] set -eu out=${1:-./build} cd "$(dirname "$0")/.." if ! git diff --quiet || ! git diff --cached --quiet; then echo "refusing to stamp a dirty tree with a commit revision" >&2 exit 1 fi rev=$(git rev-parse HEAD) built=$(git show -s --format=%cI HEAD) flags="-s -w -X orchestra/internal/buildinfo.Revision=$rev -X orchestra/internal/buildinfo.Time=$built -X orchestra/internal/buildinfo.Dirty=false" mkdir -p "$out" go build -trimpath -ldflags="$flags" -o "$out/orchestra" ./cmd/orchestra go build -trimpath -ldflags="$flags" -o "$out/orchestra-worker" ./cmd/orchestra-worker echo "$rev"