Exec psql commands in batches
This commit is contained in:
parent
3498fceb6a
commit
ab66ad83fd
@ -65,24 +65,22 @@ async function populateDatabase () {
|
|||||||
'ported/populated_places_simple_reduced',
|
'ported/populated_places_simple_reduced',
|
||||||
'cdb_analysis_check',
|
'cdb_analysis_check',
|
||||||
'cdb_invalidate_varnish'
|
'cdb_invalidate_varnish'
|
||||||
];
|
].map(filename => `${__dirname}/support/sql/${filename}.sql`);
|
||||||
|
|
||||||
for (const filename of filenames) {
|
const populateDatabaseCmd = `
|
||||||
const populateDatabaseCmd = `
|
cat ${filenames.join(' ')} |
|
||||||
cat ${__dirname}/support/sql/${filename}.sql |
|
sed -e "s/:PUBLICUSER/${PUBLIC_USER}/g" |
|
||||||
sed -e "s/:PUBLICUSER/${PUBLIC_USER}/g" |
|
sed -e "s/:PUBLICPASS/${PUBLIC_USER_PASSWORD}/g" |
|
||||||
sed -e "s/:PUBLICPASS/${PUBLIC_USER_PASSWORD}/g" |
|
sed -e "s/:TESTUSER/${TEST_USER}/g" |
|
||||||
sed -e "s/:TESTUSER/${TEST_USER}/g" |
|
sed -e "s/:TESTPASS/${TEST_PASSWORD}/g" |
|
||||||
sed -e "s/:TESTPASS/${TEST_PASSWORD}/g" |
|
PGOPTIONS='--client-min-messages=WARNING' psql -q -v ON_ERROR_STOP=1 ${TEST_DB}
|
||||||
PGOPTIONS='--client-min-messages=WARNING' psql -q -v ON_ERROR_STOP=1 ${TEST_DB}
|
`;
|
||||||
`;
|
|
||||||
|
|
||||||
await exec(populateDatabaseCmd, {
|
await exec(populateDatabaseCmd, {
|
||||||
env: {
|
env: {
|
||||||
PGUSER: 'postgres'
|
PGUSER: 'postgres'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function populateRedis () {
|
async function populateRedis () {
|
||||||
|
Loading…
Reference in New Issue
Block a user