fix(ccp-agent): export COMPOSE_PROJECT_NAME so upgrade.sh sees correct project
The agent already passed COMPOSE_PROJECT in env, but Docker Compose actually reads COMPOSE_PROJECT_NAME. When upgrade.sh (running inside the agent container at cwd=/app/instance) shelled out to `docker compose up -d` in Phase 5, compose defaulted the project name to "instance" (cwd basename), collided with the host's existing containers under "changemakerlite", and the upgrade aborted with "Container ... already in use by container ..." errors. Discovered when triggering the first end-to-end CCP "Upgrade Now" on marcelle (v2.9.15 → v2.10.1). Backup/code/rebuild phases all succeeded; migration phase failed instantly. Rollback restored marcelle cleanly. This commit adds COMPOSE_PROJECT_NAME alongside the existing COMPOSE_PROJECT (which the agent's TypeScript still reads for its own slug derivation). Bunker Admin
This commit is contained in:
parent
1b80e8294c
commit
e88ac79ae8
@ -1442,7 +1442,12 @@ services:
|
|||||||
- INSTANCE_BASE_PATH=/app/instance
|
- INSTANCE_BASE_PATH=/app/instance
|
||||||
# Pass the host's compose project name so the agent runs `docker compose -p <project>`
|
# Pass the host's compose project name so the agent runs `docker compose -p <project>`
|
||||||
# against the right project (not basename of INSTANCE_BASE_PATH, which is "instance").
|
# against the right project (not basename of INSTANCE_BASE_PATH, which is "instance").
|
||||||
|
# COMPOSE_PROJECT is read by the agent's TypeScript for slug derivation;
|
||||||
|
# COMPOSE_PROJECT_NAME is what Docker Compose itself reads when upgrade.sh
|
||||||
|
# shells out to `docker compose ...` — without it, compose defaults to
|
||||||
|
# basename(cwd)="instance" and collides with the host's existing containers.
|
||||||
- COMPOSE_PROJECT=${COMPOSE_PROJECT_NAME:-changemaker-lite}
|
- COMPOSE_PROJECT=${COMPOSE_PROJECT_NAME:-changemaker-lite}
|
||||||
|
- COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME:-changemaker-lite}
|
||||||
logging: *default-logging
|
logging: *default-logging
|
||||||
networks:
|
networks:
|
||||||
- changemaker-lite
|
- changemaker-lite
|
||||||
|
|||||||
@ -1465,7 +1465,12 @@ services:
|
|||||||
- INSTANCE_BASE_PATH=/app/instance
|
- INSTANCE_BASE_PATH=/app/instance
|
||||||
# Pass the host's compose project name so the agent runs `docker compose -p <project>`
|
# Pass the host's compose project name so the agent runs `docker compose -p <project>`
|
||||||
# against the right project (not basename of INSTANCE_BASE_PATH, which is "instance").
|
# against the right project (not basename of INSTANCE_BASE_PATH, which is "instance").
|
||||||
|
# COMPOSE_PROJECT is read by the agent's TypeScript for slug derivation;
|
||||||
|
# COMPOSE_PROJECT_NAME is what Docker Compose itself reads when upgrade.sh
|
||||||
|
# shells out to `docker compose ...` — without it, compose defaults to
|
||||||
|
# basename(cwd)="instance" and collides with the host's existing containers.
|
||||||
- COMPOSE_PROJECT=${COMPOSE_PROJECT_NAME:-changemaker-lite}
|
- COMPOSE_PROJECT=${COMPOSE_PROJECT_NAME:-changemaker-lite}
|
||||||
|
- COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME:-changemaker-lite}
|
||||||
logging: *default-logging
|
logging: *default-logging
|
||||||
networks:
|
networks:
|
||||||
- changemaker-lite
|
- changemaker-lite
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user