From 0556e8a1cac936acab0d21c4be26794d1cd976a4 Mon Sep 17 00:00:00 2001 From: Greg Konush <12027037+gregkonush@users.noreply.github.com> Date: Sat, 24 Aug 2024 21:18:03 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20add=20migrations=20init=20container?= =?UTF-8?q?=20for=20running=20database=20migrations=20on=20deployment.=20(?= =?UTF-8?q?#192)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ecran/kustomize/deployment.yaml | 10 ++++++++++ apps/ecran/package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/ecran/kustomize/deployment.yaml b/apps/ecran/kustomize/deployment.yaml index d6be353..ecc4761 100644 --- a/apps/ecran/kustomize/deployment.yaml +++ b/apps/ecran/kustomize/deployment.yaml @@ -16,6 +16,16 @@ spec: spec: imagePullSecrets: - name: gitea-registry + initContainers: + - name: run-migrations + image: gitea.proompteng.ai/d/lab/ecran:main + command: ['pnpm', 'run', 'migrations'] + env: + - name: DB_URI + valueFrom: + secretKeyRef: + name: ecran-cluster-app + key: uri containers: - name: ecran image: gitea.proompteng.ai/d/lab/ecran:main diff --git a/apps/ecran/package.json b/apps/ecran/package.json index 3c59aa1..77d064a 100644 --- a/apps/ecran/package.json +++ b/apps/ecran/package.json @@ -13,7 +13,7 @@ "db:studio": "drizzle-kit studio", "db:push": "drizzle-kit push", "db:pull": "drizzle-kit pull", - "migrate": "tsx ./src/db/migrate.ts" + "migrations": "tsx ./src/db/migrate.ts" }, "dependencies": { "@mdx-js/loader": "^3.0.1",