From 24c33295fbde59b23b2c90a1147ba408d7a3c584 Mon Sep 17 00:00:00 2001 From: mertalev <101130780+mertalev@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:30:36 -0500 Subject: [PATCH] added envs to sql generation workflow --- .github/workflows/test.yml | 2 ++ server/src/domain/domain.config.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d1fb602dd..68bb689e8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -261,6 +261,8 @@ jobs: - name: Run SQL generation run: npm run sql:generate + env: + DB_URL: postgres://postgres:postgres@localhost:5432/immich - name: Find file changes uses: tj-actions/verify-changed-files@v13.1 diff --git a/server/src/domain/domain.config.ts b/server/src/domain/domain.config.ts index 89f421dac..ca3c9c0ba 100644 --- a/server/src/domain/domain.config.ts +++ b/server/src/domain/domain.config.ts @@ -10,10 +10,11 @@ const WHEN_DB_URL_SET = Joi.when('DB_URL', { }); export const immichAppConfig: ConfigModuleOptions = { + ignoreEnvFile: process.env.USE_ENV_FILE === 'false', envFilePath: '.env', isGlobal: true, validationSchema: Joi.object({ - NODE_ENV: Joi.string().required().valid('development', 'production', 'staging').default('development'), + NODE_ENV: Joi.string().optional().valid('development', 'production', 'staging').default('development'), DB_USERNAME: WHEN_DB_URL_SET, DB_PASSWORD: WHEN_DB_URL_SET, DB_DATABASE_NAME: WHEN_DB_URL_SET,