Added xxl options to data generation (#19488)

no issue

Allows switching between 100k members vs 2M members
This commit is contained in:
Simon Backx 2024-01-16 11:20:33 +01:00 committed by GitHub
parent 5b2de17ac7
commit ea7290c0da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -121,7 +121,14 @@ async function runAndStream(command, args, options) {
await runAndStream('yarn', ['knex-migrator', 'init'], {cwd: coreFolder});
if (resetData) {
console.log(chalk.blue(`Resetting all data`));
await runAndStream('yarn', ['reset:data'], {cwd: rootFolder});
const xxl = process.argv.includes('--xxl');
if (xxl) {
console.log(chalk.blue(`Resetting all data (with xxl)`));
await runAndStream('yarn', ['reset:data:xxl'], {cwd: rootFolder});
} else {
console.log(chalk.blue(`Resetting all data`));
await runAndStream('yarn', ['reset:data'], {cwd: rootFolder});
}
}
})();

View File

@ -30,7 +30,8 @@
"fix": "yarn cache clean && rimraf -g '**/node_modules' && yarn",
"knex-migrator": "yarn workspace ghost run knex-migrator",
"setup": "yarn && git submodule update --init && NODE_ENV=development node .github/scripts/setup.js",
"reset:data": "cd ghost/core && node index.js generate-data --clear-database --quantities members:2000000,posts:0,emails:0,members_stripe_customers:0,members_login_events:0,members_status_events:0 --seed 123",
"reset:data": "cd ghost/core && node index.js generate-data --clear-database --quantities members:100000,posts:500 --seed 123",
"reset:data:xxl": "cd ghost/core && node index.js generate-data --clear-database --quantities members:2000000,posts:0,emails:0,members_stripe_customers:0,members_login_events:0,members_status_events:0 --seed 123",
"docker:reset": "docker-compose -f .github/scripts/docker-compose.yml down -v && docker-compose -f .github/scripts/docker-compose.yml up -d --wait",
"lint": "nx run-many -t lint",
"test": "nx run-many -t test",