Extract API, migrations and portable NAS deployment
This commit is contained in:
commit
673255fa4f
57 files changed
+3799
No files matched your search
@@ -0,0 +1,9 @@
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { compose } from './compose.mjs';
|
||||
// The fixed, separate database is never dropped. No credentials are passed on the command line.
|
||||
compose(['exec', '-T', 'db', 'sh', '-c', `export MYSQL_PWD="$MARIADB_ROOT_PASSWORD"; mariadb -u root -e "CREATE DATABASE IF NOT EXISTS model_delivery_test CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; GRANT ALL PRIVILEGES ON model_delivery_test.* TO '$MARIADB_USER'@'%';"`]);
|
||||
for (const script of ['db:migrate', 'db:seed']) {
|
||||
// pnpm exposes its JS entry point to scripts; invoking Node avoids Windows shell quoting.
|
||||
const result = spawnSync(process.execPath, [process.env.npm_execpath, script], { stdio: 'inherit', env: { ...process.env, DB_NAME: 'model_delivery_test' } });
|
||||
if (result.status !== 0) process.exit(result.status ?? 1);
|
||||
}
|
||||
Reference in new issue
Block a user