Skip to content

Phase 3 — Move deploy engine from Projects to Systems/Environments #33

Description

@b5463

Part of Milestone B — V4 Operational Core. Ref: #27

Make deployment target a system_environment, not a project.


Alex tasks

New deployment routes

  • POST /api/systems/:systemId/environments/:environment/deploy
  • POST /api/systems/:systemId/environments/:environment/redeploy
  • POST /api/systems/:systemId/environments/:environment/rollback
  • GET /api/systems/:systemId/environments/:environment/logs
  • GET /api/systems/:systemId/environments/:environment/stats

Legacy route preservation

  • POST /api/deploy — calls new deployment service through mapping layer
  • POST /api/projects/:slug/redeploy — same
  • POST /api/projects/:slug/rollback — same

Deploy service extraction

Extract from current deploy route into service:

  • deployService.detect()
  • deployService.extract()
  • deployService.build()
  • deployService.runContainer()
  • deployService.verifyHealth()
  • deployService.recordRelease()
  • deployService.publishRoute()
  • deployService.rollback()

Docker labels

Add to all containers:

  • systems.organisation_id
  • systems.system_id
  • systems.environment_id
  • systems.release_id
  • systems.slug
  • systems.environment

Preview environment

  • Backend support for production and preview environments
  • POST /api/systems/:systemId/promote with full flow:
    • Preview release exists
    • Health/readiness passes
    • Production container starts
    • Production route switches
    • Previous production retained
    • Release recorded

Tests

  • New deploy route deploys to environment
  • Legacy deploy route still works
  • Container labels are present
  • Preview deploy does not affect production
  • Promotion switches production only after health passes
  • Rollback returns previous release
  • Failed deploy leaves old release running

Do not build yet

Custom domains, portfolio, Stripe, product-key generation.

Exit gate

  • One test app can deploy through new systems route
  • Legacy deploy still works
  • Preview and production can coexist
  • Rollback works
  • Caddy routes still publish correctly

Rollback

Legacy deploy routes remain available. Disable ENABLE_V4_SYSTEM_DEPLOY.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions