#!/usr/bin/env bash # update-project.sh — bump a fleet project's harness submodule to a new ref. # # Updating the engine for a project = checkout a new ref of its `engine/` submodule + commit, IN # THAT PROJECT'S REPO ONLY. It touches no other project (each pins its own copy). Afterwards, update # the project's `ref` in this PO's fleet.toml so the registry stays accurate. set -euo pipefail [ $# -ge 2 ] || { echo "usage: update-project.sh " >&2; exit 1; } NAME="$1"; NEWREF="$2" source "$(dirname "$0")/_resolve.sh" IFS=$'\t' read -r LOCATION CONFIG HARNESS < <(resolve_project "$NAME") [ -d "$LOCATION" ] || { echo "update-project: location not a local dir: $LOCATION" >&2; exit 1; } [ "$HARNESS" = "agent-orchestrator" ] || { echo "update-project: harness '$HARNESS' not agent-orchestrator — update by hand per its docs." >&2; exit 2; } echo "update-project: $NAME engine → $NEWREF (in $LOCATION)" ( cd "$LOCATION/engine" && git fetch -q --tags origin && git checkout -q "$NEWREF" ) ( cd "$LOCATION" && git add engine \ && git -c user.name="project-orchestrator" -c user.email="po@localhost" \ commit -q -m "chore: bump engine to $NEWREF" ) echo "update-project: project committed. Now update fleet.toml: set ref = \"$NEWREF\" for '$NAME'." echo " (edit $(cd "$(dirname "$0")/.." && pwd)/fleet.toml, then: python3 scripts/fleet.py validate)"