From be55d46391e2eb70ff6d79523a3c41951ccdd389 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 19 Oct 2024 17:42:24 -0400 Subject: [PATCH] Separate ci env from test env --- .env.ci | 6 ++++++ .env.test | 3 ++- api/data/settings.ts | 2 +- package.json | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .env.ci diff --git a/.env.ci b/.env.ci new file mode 100644 index 0000000..c73762e --- /dev/null +++ b/.env.ci @@ -0,0 +1,6 @@ +DATABASE="postgres" +POSTGRES_PASSWORD="testpassword" +POSTGRES_HOST="database" +POSTGRES_PORT=5432 +VAPID_PRIVATE_KEY="privatekey" +BASE_URL="http://localhost:5173" \ No newline at end of file diff --git a/.env.test b/.env.test index d358a67..3d3b270 100644 --- a/.env.test +++ b/.env.test @@ -1,5 +1,6 @@ DATABASE="postgres" POSTGRES_PASSWORD="testpassword" -POSTGRES_HOST="database" +POSTGRES_HOST="localhost" +POSTGRES_PORT=5434 VAPID_PRIVATE_KEY="privatekey" BASE_URL="http://localhost:5173" \ No newline at end of file diff --git a/api/data/settings.ts b/api/data/settings.ts index 176adab..d8ed598 100644 --- a/api/data/settings.ts +++ b/api/data/settings.ts @@ -3,5 +3,5 @@ export default { host: process.env.POSTGRES_HOST ?? "database", user: "postgres", password: process.env.POSTGRES_PASSWORD, - port: 5432, + port: process.env.POSTGRES_PORT ?? 5432, } diff --git a/package.json b/package.json index e980528..711af7e 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "typecheck": "tsc", "watch": "export $(cat .env.test | xargs) && docker compose -f docker-compose-test.yaml up database -d --remove-orphans && jest --watch --config=jest.config.ts", "test": "export $(cat .env.test | xargs) && docker compose -f docker-compose-test.yaml up database -d --remove-orphans && sleep 5 && jest --config=jest.config.ts", - "ci": "export $(cat .env.test | xargs) && jest --config=jest.config.ts" + "ci": "export $(cat .env.ci | xargs) && jest --config=jest.config.ts" }, "dependencies": { "@remix-pwa/sw": "^3.0.9",