MATIH Platform is in active MVP development. Documentation reflects current implementation status.
7. Tenant Lifecycle
Platform Deployment
Platform Rollback

Platform Rollback

Platform rollback marks a deployment as rolled back and is used in conjunction with the CD pipeline's rollback scripts to revert to a previous platform version. The rollback endpoint updates deployment records to maintain an accurate history.


Marking a Deployment as Rolled Back

POST /api/v1/platform/deployments/tag/v2.1.0-abc1234/rollback

This endpoint:

  1. Finds the deployment record by image tag
  2. Updates its status to ROLLED_BACK
  3. Records the rollback timestamp
  4. Returns the updated deployment record

Rollback Process

The full platform rollback involves multiple coordinated steps:

StepAction
1Identify the target version from deployment history
2Mark the current deployment as ROLLED_BACK via the API
3CD pipeline deploys the target image tag
4Record the new deployment (which points to the older version)
5Verify platform health after rollback

Finding Rollback Targets

To identify which version to roll back to, query the deployment history:

GET /api/v1/platform/deployments/history?environment=prod&limit=5

Look for the most recent deployment with DEPLOYED status that predates the problematic deployment.


Rollback vs. New Deployment

A rollback is functionally a new deployment of an older version. The deployment history reflects this:

EntryImage TagStatus
Latestv2.0.0-def5678DEPLOYED (rollback target redeployed)
Previousv2.1.0-abc1234ROLLED_BACK
Earlierv2.0.0-def5678DEPLOYED (original)

Rollback Safety

Before performing a rollback:

  • Verify the target version's deployment record exists (GET .../tag/:imageTag/exists)
  • Check that the target version's container images are still available in the registry
  • Review the deployment notes for any migration steps that may need reversal
  • Consider database migrations that may not be backward-compatible

Automated Rollback

The CD pipeline can be configured for automated rollback when health checks fail after a deployment. The automation:

  1. Detects health check failure within the configured window
  2. Identifies the previous successful deployment
  3. Marks the failed deployment as ROLLED_BACK
  4. Redeploys the previous version
  5. Sends a notification to the operations team