All checks were successful
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
87 lines
2.5 KiB
YAML
87 lines
2.5 KiB
YAML
# docker-compose-upgrade.yml — Upgrade Testing (Postgres)
|
|
#
|
|
# Two-phase environment: run the "old" image to seed data, then
|
|
# swap in the "new" image and verify data integrity post-upgrade.
|
|
#
|
|
# Usage:
|
|
# ci/e2e-upgrade-test.sh (orchestrates build → seed → upgrade → verify)
|
|
#
|
|
# Manual usage:
|
|
# docker build -t armature:v-old .
|
|
# docker compose -f docker-compose-upgrade.yml up postgres armature-old -d
|
|
# # ... seed data ...
|
|
# docker compose -f docker-compose-upgrade.yml stop armature-old
|
|
# docker compose -f docker-compose-upgrade.yml up armature-new -d
|
|
# # ... verify data ...
|
|
# docker compose -f docker-compose-upgrade.yml down -v
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: armature_upgrade
|
|
POSTGRES_USER: armature
|
|
POSTGRES_PASSWORD: upgrade-password
|
|
ports:
|
|
- "5433:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U armature -d armature_upgrade"]
|
|
interval: 2s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
armature-old:
|
|
image: armature:v-old
|
|
environment:
|
|
PORT: "8080"
|
|
BASE_PATH: ""
|
|
DB_DRIVER: postgres
|
|
DATABASE_URL: postgres://armature:upgrade-password@postgres:5432/armature_upgrade?sslmode=disable
|
|
JWT_SECRET: upgrade-jwt-secret
|
|
ENCRYPTION_KEY: upgrade-encryption-key-32chars!!
|
|
ARMATURE_ADMIN_USERNAME: admin
|
|
ARMATURE_ADMIN_PASSWORD: admin
|
|
STORAGE_BACKEND: pvc
|
|
STORAGE_PATH: /data/storage
|
|
CORS_ALLOWED_ORIGINS: "*"
|
|
EXT_ALLOW_PRIVATE_IPS: "true"
|
|
LOG_FORMAT: text
|
|
LOG_LEVEL: info
|
|
SEED_USERS: "alice:password123:user,bob:password456:user"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
ports:
|
|
- "3001:80"
|
|
volumes:
|
|
- upgrade_storage:/data/storage
|
|
|
|
armature-new:
|
|
image: core-armature-new
|
|
environment:
|
|
PORT: "8080"
|
|
BASE_PATH: ""
|
|
DB_DRIVER: postgres
|
|
DATABASE_URL: postgres://armature:upgrade-password@postgres:5432/armature_upgrade?sslmode=disable
|
|
JWT_SECRET: upgrade-jwt-secret
|
|
ENCRYPTION_KEY: upgrade-encryption-key-32chars!!
|
|
ARMATURE_ADMIN_USERNAME: admin
|
|
ARMATURE_ADMIN_PASSWORD: admin
|
|
STORAGE_BACKEND: pvc
|
|
STORAGE_PATH: /data/storage
|
|
CORS_ALLOWED_ORIGINS: "*"
|
|
EXT_ALLOW_PRIVATE_IPS: "true"
|
|
LOG_FORMAT: text
|
|
LOG_LEVEL: info
|
|
SEED_USERS: "alice:password123:user,bob:password456:user"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
ports:
|
|
- "3001:80"
|
|
volumes:
|
|
- upgrade_storage:/data/storage
|
|
|
|
volumes:
|
|
upgrade_storage:
|