Merge pull request #2674 from lowjoel/postgres-create-database

Auto-create plugin databases
This commit is contained in:
Fredrik Adelöw
2020-10-01 11:17:11 +02:00
committed by GitHub
4 changed files with 66 additions and 1 deletions
+7
View File
@@ -24,6 +24,7 @@
import Router from 'express-promise-router';
import {
ensureDatabaseExists,
createDatabaseClient,
createServiceBuilder,
loadBackendConfig,
@@ -68,6 +69,12 @@ async function main() {
const configs = await loadBackendConfig();
const configReader = ConfigReader.fromConfigs(configs);
const createEnv = makeCreateEnv(configs);
await ensureDatabaseExists(
configReader.getConfig('backend.database'),
'backstage_plugin_catalog',
'backstage_plugin_auth',
);
const healthcheckEnv = useHotMemoize(module, () => createEnv('healthcheck'));
const catalogEnv = useHotMemoize(module, () => createEnv('catalog'));
const scaffolderEnv = useHotMemoize(module, () => createEnv('scaffolder'));