fix: make migrations use readConfig
This commit is contained in:
parent
e9e30c4c46
commit
166087e33c
2 changed files with 6 additions and 6 deletions
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
|
@ -3,6 +3,10 @@ name: 'CD: Push Docker Images'
|
|||
on:
|
||||
push:
|
||||
branches: [ trunk ]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'server/**'
|
||||
- 'prisma/**'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
|
|
@ -3,16 +3,12 @@ const { existsSync } = require('fs');
|
|||
const { join, extname } = require('path');
|
||||
const validateConfig = require('../server/validateConfig');
|
||||
const Logger = require('../src/lib/logger');
|
||||
const readConfig = require('../src/lib/readConfig');
|
||||
const mimes = require('./mimes');
|
||||
const { PrismaClient } = require('@prisma/client');
|
||||
|
||||
(async () => {
|
||||
const str = await readFile('./config.toml');
|
||||
const config = require('@iarna/toml/parse-string')(str);
|
||||
if (!existsSync(join(process.cwd(), 'prisma', 'migrations'))) {
|
||||
Logger.get('server').info('detected an uncreated database - creating...');
|
||||
await require('../scripts/deploy-db')(config);
|
||||
}
|
||||
const config = readConfig();
|
||||
|
||||
await validateConfig(config);
|
||||
|
||||
|
|
Loading…
Reference in a new issue