From 38e9bddc5c0830e4a002e09b3d0bd0138019288a Mon Sep 17 00:00:00 2001 From: williams-jack Date: Sun, 14 Jul 2024 22:33:14 -0400 Subject: [PATCH] refactor: compatible db port for local dev; fix schema for list of command --- .../src/validations/schemas/grading-job-config.ts | 10 ++++++++-- orchestrator/packages/db/run-migration | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/orchestrator/packages/common/src/validations/schemas/grading-job-config.ts b/orchestrator/packages/common/src/validations/schemas/grading-job-config.ts index 41f60633..b9d82622 100644 --- a/orchestrator/packages/common/src/validations/schemas/grading-job-config.ts +++ b/orchestrator/packages/common/src/validations/schemas/grading-job-config.ts @@ -18,7 +18,10 @@ const bashGradingScriptCommand = { on_complete: { anyOf: [ { - $ref: "https://orca-schemas.com/grading-job-config/grading-script-command", + type: "array", + items: { + $ref: "https://orca-schemas.com/grading-job-config/grading-script-command", + } }, { type: "string" }, { type: "number" }, @@ -27,7 +30,10 @@ const bashGradingScriptCommand = { on_fail: { anyOf: [ { - $ref: "https://orca-schemas.com/grading-job-config/grading-script-command", + type: "array", + items: { + $ref: "https://orca-schemas.com/grading-job-config/grading-script-command", + } }, { type: "string" }, { type: "number" }, diff --git a/orchestrator/packages/db/run-migration b/orchestrator/packages/db/run-migration index 87dc9ee8..1bbf15a8 100755 --- a/orchestrator/packages/db/run-migration +++ b/orchestrator/packages/db/run-migration @@ -8,7 +8,7 @@ fi migration_name="$1" container_name='postgres-migration' -docker run --rm -p 5432:5432 -v db-data:/var/lib/postgresql/data \ +docker run --rm -p 5434:5432 -v db-data:/var/lib/postgresql/data \ -e POSTGRES_PASSWORD=password --name "$container_name" -d postgres:10 > /dev/null if [[ $? -ne 0 ]]; then @@ -16,6 +16,6 @@ if [[ $? -ne 0 ]]; then exit 1 fi -export POSTGRES_URL=postgresql://postgres:password@localhost +export POSTGRES_URL=postgresql://postgres:password@localhost:5434 npx prisma migrate dev --name $1 docker stop "$container_name" > /dev/null