Add all repos
This commit is contained in:
parent
faa12c60bc
commit
8a91c9b89b
369 changed files with 29047 additions and 28 deletions
67
metamigo-cli/index.ts
Normal file
67
metamigo-cli/index.ts
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
import { Command } from "commander";
|
||||
import { startWithout } from "@digiresilience/montar";
|
||||
import { migrateWrapper } from "db";
|
||||
import { loadConfig } from "config";
|
||||
import { genConf, listConfig } from "./config";
|
||||
import { createTokenForTesting, generateJwks } from "./jwks";
|
||||
import { exportGraphqlSchema } from "./postgraphile";
|
||||
import "api/build/main/server";
|
||||
import "api/build/main/logger";
|
||||
import "worker/build/main";
|
||||
|
||||
const program = new Command();
|
||||
|
||||
export async function runServer(): Promise<void> {
|
||||
await startWithout(["worker"]);
|
||||
}
|
||||
|
||||
export async function runWorker(): Promise<void> {
|
||||
await startWithout(["server"]);
|
||||
}
|
||||
|
||||
program
|
||||
.command("config-generate")
|
||||
.description("Generate a sample JSON configuration file (to stdout)")
|
||||
.action(genConf);
|
||||
|
||||
program
|
||||
.command("config-help")
|
||||
.description("Prints the entire convict config ")
|
||||
.action(listConfig);
|
||||
|
||||
program
|
||||
.command("api")
|
||||
.description("Run the application api server")
|
||||
.action(runServer);
|
||||
|
||||
program
|
||||
.command("worker")
|
||||
.description("Run the worker to process jobs")
|
||||
.action(runWorker);
|
||||
|
||||
program
|
||||
.command("db <commands...>")
|
||||
.description("Run graphile-migrate commands with your app's config loaded.")
|
||||
.action(async (args) => {
|
||||
const config = await loadConfig();
|
||||
return migrateWrapper(args, config);
|
||||
});
|
||||
|
||||
program
|
||||
.command("gen-jwks")
|
||||
.description("Generate the JWKS")
|
||||
.action(generateJwks);
|
||||
|
||||
program
|
||||
.command("gen-testing-jwt")
|
||||
.description("Generate a JWT for the test suite")
|
||||
.action(createTokenForTesting);
|
||||
|
||||
program
|
||||
.command("export-graphql-schema")
|
||||
.description("Export the graphql schema")
|
||||
.action(exportGraphqlSchema);
|
||||
|
||||
program.parse(process.argv);
|
||||
Loading…
Add table
Add a link
Reference in a new issue