ci: make the install rehearsal work with compose v1
The rehearsal reached "First boot" — bundle assembled, signed, verified offline, images loaded, install staged — and then died with `unknown flag: --project-directory`. That message is misleading: gw-04 has no docker compose v2 plugin at all, only docker-compose 1.29.2, so `docker compose` is parsed as `docker` with a bogus flag rather than reported as a missing plugin. Use the same v2-then-v1 fallback deploy/gw-04/clawmates-deploy.sh already needs. v1.29.2 supports --project-directory, so the invocations are otherwise unchanged. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
bd1c970577
commit
9441cf401c
@@ -9,10 +9,21 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
|
||||||
|
# Prefer `docker compose` (v2 plugin), fall back to legacy `docker-compose`.
|
||||||
|
# Same portability the rolling deploy already needs: gw-04 — where the release
|
||||||
|
# job runs — ships only docker-compose 1.29.2, and `docker compose` there fails
|
||||||
|
# with "unknown flag: --project-directory", which reads like a bad argument
|
||||||
|
# rather than a missing plugin. Mirrors deploy/gw-04/clawmates-deploy.sh.
|
||||||
|
if docker compose version >/dev/null 2>&1; then
|
||||||
|
COMPOSE="docker compose"
|
||||||
|
else
|
||||||
|
COMPOSE="docker-compose"
|
||||||
|
fi
|
||||||
WORK="$(mktemp -d)"
|
WORK="$(mktemp -d)"
|
||||||
export CLAWMATES_HOME="$WORK/opt"
|
export CLAWMATES_HOME="$WORK/opt"
|
||||||
cleanup() {
|
cleanup() {
|
||||||
docker compose --project-directory "$CLAWMATES_HOME" down -v >/dev/null 2>&1 || true
|
$COMPOSE --project-directory "$CLAWMATES_HOME" down -v >/dev/null 2>&1 || true
|
||||||
rm -rf "$WORK"
|
rm -rf "$WORK"
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
@@ -60,7 +71,7 @@ echo "==> Customer install: verify -> load -> stage"
|
|||||||
|
|
||||||
echo "==> First boot"
|
echo "==> First boot"
|
||||||
echo "POSTGRES_PASSWORD=rehearse-$$" > "$CLAWMATES_HOME/.env"
|
echo "POSTGRES_PASSWORD=rehearse-$$" > "$CLAWMATES_HOME/.env"
|
||||||
docker compose --project-directory "$CLAWMATES_HOME" up -d --no-build
|
$COMPOSE --project-directory "$CLAWMATES_HOME" up -d --no-build
|
||||||
|
|
||||||
echo "==> Waiting for the platform"
|
echo "==> Waiting for the platform"
|
||||||
for _ in $(seq 1 60); do
|
for _ in $(seq 1 60); do
|
||||||
@@ -76,5 +87,5 @@ for _ in $(seq 1 60); do
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo "REHEARSAL FAILED: platform never became healthy"
|
echo "REHEARSAL FAILED: platform never became healthy"
|
||||||
docker compose --project-directory "$CLAWMATES_HOME" logs --tail 30
|
$COMPOSE --project-directory "$CLAWMATES_HOME" logs --tail 30
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user