feat: add snapshot/rollback system with download capability
- Add AppSnapshot entity with type (pre_deploy/manual), status tracking, and file paths - Add SnapshotsService with create, capture, rollback, prune (max 10), and download logic - Add SnapshotsController with REST endpoints for CRUD, rollback, and file downloads - Add K8s methods: exportDatabaseDump, archiveWpContent, restoreWpContent - Auto-create pre-deploy snapshots before each deployment for rollback safety - Support downloading current live state (source, wp-content, database) without snapshots - Add snapshot management UI in app detail page with create, rollback, download, delete - Wire circular dependencies with forwardRef between Deployments and Snapshots modules
This commit is contained in:
@@ -287,3 +287,27 @@ export interface CostBreakdown {
|
||||
yearly: number;
|
||||
breakdown: { label: string; hourly: number; monthly: number; yearly: number }[];
|
||||
}
|
||||
|
||||
// ─── Snapshot / Rollback types ──────────────────────
|
||||
|
||||
export type SnapshotType = 'pre_deploy' | 'manual';
|
||||
export type SnapshotStatus = 'in_progress' | 'completed' | 'failed';
|
||||
|
||||
export interface AppSnapshot {
|
||||
id: string;
|
||||
type: SnapshotType;
|
||||
status: SnapshotStatus;
|
||||
label?: string;
|
||||
appArchivePath?: string;
|
||||
wpContentArchivePath?: string;
|
||||
imageTag?: string;
|
||||
dbDumpPath?: string;
|
||||
hasDatabase: boolean;
|
||||
appArchiveSize?: number;
|
||||
dbDumpSize?: number;
|
||||
wpContentSize?: number;
|
||||
errorMessage?: string;
|
||||
applicationId: string;
|
||||
createdBy: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user