Skip to content

Commit

Permalink
Run database migrations in CI before E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joonashak committed Jun 24, 2024
1 parent 9dedbad commit fc3179f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ jobs:
path: /tmp
- name: Load image
run: docker load --input /tmp/keijo.tar
# - name: Run database migrations
# run: docker compose -f compose.ci.yaml run server npm run migrations:run
- name: Start backend
run: docker compose -f compose.ci.yaml up -d server
- name: Wait for backend
Expand Down
10 changes: 5 additions & 5 deletions server/migration-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { DataSource } from "typeorm";

export default new DataSource({
type: "postgres",
host: "localhost",
port: 5432,
username: "postgres",
password: "postgres",
database: "keijo_dev",
host: process.env.DATABASE_HOST || "localhost",
port: Number(process.env.DATABASE_PORT) || 5432,
username: process.env.DATABASE_USERNAME || "postgres",
password: process.env.DATABASE_PASSWORD || "postgres",
database: process.env.DATABASE_NAME || "keijo_dev",
migrations: ["src/database/migrations/*"],
});

0 comments on commit fc3179f

Please sign in to comment.