sota.io

Rollback

Revert to the previous deployment by swapping container images without rebuilding.

Trigger Rollback

POST /v1/projects/:id/rollback
curl -X POST https://api.sota.io/v1/projects/550e8400-.../rollback \
  -H "Authorization: Bearer <token>"

Response (200 OK):

{
  "data": {
    "id": "8d3e7f2a-4567-8901-bcde-f01234567890",
    "project_id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "deploying",
    "image_tag": "registry.sota.io/my-app:prev-tag",
    "url": "my-app.sota.io",
    "created_at": "2026-02-25T15:00:00Z",
    "updated_at": "2026-02-25T15:00:00Z"
  }
}

The response contains the new deployment object created by the rollback.

How It Works

  1. The previous deployment's Docker image is started as a new container
  2. Health checks run against the new container
  3. Traefik traffic is swapped (blue-green)
  4. The failed container is stopped and cleaned up

The rollback reuses the Deploy() flow internally with the previous image tag -- there is no separate rollback mechanism.

Limitations

  • Only the immediately previous deployment is available for rollback
  • Environment variables are not rolled back (they persist across deployments)
  • If no previous deployment exists, the API returns a 409 Conflict error
  • If no running deployment exists, the API returns a 409 Conflict error