feat: Add seed command support to preview deployments

Run project-specific initialization commands (DB migrations, fixture
loading, etc.) automatically after containers are healthy, before the
preview is marked ready. Configured via per-service `seed` arrays in
.cw-preview.yml.
This commit is contained in:
Lukas May
2026-03-05 12:39:02 +01:00
parent 3913aa2e28
commit 714262fb83
8 changed files with 158 additions and 2 deletions

View File

@@ -101,6 +101,7 @@ export function parseCwPreviewConfig(raw: string): PreviewConfig {
...(svc.healthcheck !== undefined && { healthcheck: svc.healthcheck as PreviewServiceConfig['healthcheck'] }),
...(svc.env !== undefined && { env: svc.env as Record<string, string> }),
...(svc.volumes !== undefined && { volumes: svc.volumes as string[] }),
...(Array.isArray(svc.seed) && { seed: svc.seed as string[] }),
...(svc.dev !== undefined && {
dev: {
image: (svc.dev as Record<string, unknown>).image as string,